Determine if this path is an ancestor of the supplied path.

@param AbsolutePathInterface $path The child path.

@return boolean True if this path is an ancestor of the supplied path.
330332
public function isAncestorOf(AbsolutePathInterface $path)
    {
        $parentAtoms = $this->normalize()->atoms();

        return $parentAtoms === array_slice(
            $path->normalize()->atoms(),
            0,
            count($parentAtoms)
        );
    }
595248
public static function isAbsolute($path)
    {
        return ((isset($path[0])
                ? ($path[0] == '/'
                    || (ctype_alpha($path[0]) && ($path[1] == ':')))
                : '')
            || (parse_url($path, PHP_URL_SCHEME) === true))
            ? true
            : false;
    }
1143983
public function resolvePath($path)
    {
        if ($path[0] == '/') {
            throw new \InvalidArgumentException('Cannot resolve absolute path.');
        }

        $segments = $this->getPathSegments();
        if (!empty($segments)) {
            // Remove the last segment for relative paths.
            array_pop($segments);
        }
        $path = trim($path, '/');
        foreach (explode('/', trim($path, '/')) as $segment) {
            if ($segment == '.') {
                continue;
            }
            elseif ($segment == '..' && !empty($segments) && end($segments) != '..') {
                array_pop($segments);
            }
            else {
                $segments[] = $segment;
            }
        }

        return implode('/', $segments);
    }
802656
private function isInRoot(string $path): bool
    {
        return substr($path, 0, strlen(self::$root->getName())) === self::$root->getName();
    }
314998
public function resolve(
        AbsolutePathInterface $basePath,
        PathInterface $path
    ) {
        if ($path instanceof AbsolutePathInterface) {
            return $path;
        }

        return $basePath->join($path);
    }
197501
protected function validatePath($path)
    {
        if (empty($path)) {
            return false;
        }

        // we are always operating from root directory
        // so forbid relative paths
        if (false !== strpos($path, '..')) {
            return false;
        }

        return true;
    }
365293
public function isdir( $path )
	{
		return in_array( basename( $path ), $this->fs->directories( dirname( $path ) ) );
	}
488353
public static function isAbsolute($path)
    {
        if (empty($path)) {
            return false;
        }

        return $path[0] === '/' ||
            preg_match('/^[A-Z]:\\\\/i', $path) ||
            substr($path, 0, 2) === '\\\\' ||
            self::isRegisteredStreamWrapper($path);
    }
185393
public static function is_absolute($path)
    {
        if (empty($path)) {
            return false;
        }
        if ($path[0] == '/' || $path[0] == '\\') {
            return true;
        }
        return preg_match('/^[a-zA-Z]:[\\\\\/]/', $path) == 1;
    }
82694
public function hasAncestor($ancestor)
    {
        if (!$this->hasParent()) {
            return false;
        }
        if ($this->parent->getRefId() == $ancestor->getRefId()) {
            return true;
        }
        return $this->parent->hasAncestor($ancestor);
    }
1205126
public function absolute($relativePath = null)
    {
        if ($this->isEmptyPath($relativePath)) {
            return $this->basePath;
        }

        if ($this->startsWithBasePath($relativePath)) {
            return $relativePath;
        }

        if (!$baseUrl = $this->getBaseUrl()) {
            return $this->basePath.'/'.trim($relativePath, '/');
        }

        if ($this->startsWithBaseUrl($relativePath)) {
            return $this->absolute($this->relative($relativePath));
        }

        return $this->basePath.'/'.trim($relativePath, '/');
    }
1017277
protected static function isValidPath($path)
    {
        if (strpos($path, '?') !== false) {
            return false;
        }
        if (strpos($path, '*') !== false) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return false;
        }
        if (strpos($path, '|') !== false) {
            return false;
        }
        if (strpos($path, '\\') !== false) {
            return false;
        }
        if (strpos($path, '<') !== false) {
            return false;
        }
        if (strpos($path, '>') !== false) {
            return false;
        }
        if (strpos($path, '"') !== false) {
            return false;
        }

        return true;
    }
108646
protected function _abspath($path) {
		return $path == DIRECTORY_SEPARATOR ? $this->root : $this->root.DIRECTORY_SEPARATOR.$path;
	}
910130
public function isVirtual($path): bool
    {
        $parts = explode(':', $path, 2);

        list($alias) = $parts;
        $alias = $this->cleanAlias($alias);
        if (!array_key_exists($alias, $this->paths) && $this->prefix($path) !== null) {
            return false;
        }

        return count($parts) === 2;
    }
5891
public static function isAbsolute($path)
    {
        if (($position = strpos($path, './')) !== false && $position <= 2) {
            return false;
        }
        if (strpos($path, ':') !== false) {
            return true;
        }
        if (substr($path, 0, 1) === '/') {
            return true;
        }
        return false;
    }
779931
public function ancestor($route, $path = null)
    {
        if ($path !== null) {
            $page = $this->dispatch($route, true);

            if ($page && $page->path() === $path) {
                return $page;
            }

            $parent = $page ? $page->parent() : null;
            if ($parent && !$parent->root()) {
                return $this->ancestor($parent->route(), $path);
            }
        }

        return null;
    }
653430
protected function normalizeAbsoluteWindowsPath(
        AbsoluteWindowsPathInterface $path
    ) {
        return $this->factory()->createFromDriveAndAtoms(
            $this->normalizeAbsolutePathAtoms($path->atoms()),
            $this->normalizeDriveSpecifier($path->drive()),
            true,
            false,
            false
        );
    }