Get remaining uri path extracted from the passed one.
@param string $path
@return string path
428818
public function getRemainingPath($path)
	{
		$paths = explode('/', $path);
		
		$newPaths	= array();

		for($i = count(explode('/', $this->properties['path'])); $i < count($paths); $i++)
			$newPaths[]	= $paths[$i];

		return $this->properties['path'] != '' ? implode('/', $newPaths) : $path;
	}
924588
protected function realpath($path)
    {
        if ($path === '') {
            return $this->baseDir;
        }

        if ($path[0] === '/' || $path[1] === ':') {
            return $path;
        }

        return $this->baseDir . '/' . $path;
    }
406291
public function locate($path)
    {
        if (substr($path, 0, 1) == '@') {
            $path = $this->kernel->locateResource($path);
        } else {
            $path = $this->kernel->getRootDir() . DIRECTORY_SEPARATOR . $path;
        }

        return $path;
    }
660822
private function makeSurePathIsAbsolute($path)
    {
        $baseUrl = rtrim($this->getParameter('base_url'), '/').'/';

        return 0 !== strpos($path, 'http') ? $baseUrl.ltrim($path, '/') : $path;
    }
808377
public static function getAbsolutePath(string $path): string
    {
        $parts = \preg_split('~[/\\\\]+~', $path, 0, \PREG_SPLIT_NO_EMPTY);
        $absolutes = [];
        foreach ($parts as $part) {
            if ('.' === $part) {
                continue;
            }
            if ('..' === $part) {
                \array_pop($absolutes);
            } else {
                $absolutes[] = $part;
            }
        }

        /**
         * Allows to dereference char
         */
        $__FILE__ = \preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
        $prefix = $__FILE__[0] === \DIRECTORY_SEPARATOR ? \DIRECTORY_SEPARATOR : '';
        return $prefix . \implode(\DIRECTORY_SEPARATOR, $absolutes);
    }
654344
public function pathToUrl($path) {
        if (empty($this->config['url_prefix'])) return '/'.$path;
        else if (empty($this->config['path'])) return rtrim($this->config['url_prefix'], '/').'/'.$path;
        else return rtrim($this->config['url_prefix'], '/').'/'.$this->relativePath($path);
    }
366541
public function getPathParts($path)
    {
        $path = preg_replace('/\[/', '->[', $path);
        if (preg_match('/^->/', $path)) {
            $path = substr($path, 2);
        }

        return explode('->', $path);
    }
1168713
protected function mergePath(string $path): string
    {
        $base_path = $this->base_uri->getPath();
        if ('' !== $this->base_uri->getAuthority() && '' === $base_path) {
            return (string) $this->filterPath($path)->withLeadingSlash();
        }

        if ('' !== $base_path) {
            $segments = explode('/', $base_path);
            array_pop($segments);
            $path = implode('/', $segments).'/'.$path;
        }

        return $path;
    }
10623
private function realpath($path)
    {
        if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {
            return $path;
        }

        return $this->baseDir . '/' . $path;
    }
351071
public function resourcePath($path = '')
    {
        if ($this->resourcePath) {
            return $this->resourcePath.($path ? '/'.$path : $path);
        }

        return $this->basePath('resources'.($path ? '/'.$path : $path));
    }
524729
public function relPath($path = null)
    {
        # Cleaning path
        $path = preg_replace('/^\//', '', $path);

        return str_replace(public_path(), '', $this->getCurrentPath() . '/' . $path);
    }
1032454
protected function _getRalativePath($path)
    {
        if ($path) {
            $rootPath = str_replace(array('/', '\\'), '/', self::$_config['root']);

            $path = str_replace(array('/', '\\'), '/', $path);
            $path = str_replace($rootPath, '/', $path);
            $path = str_replace('//', '/', $path);
            $path = trim($path, '/');
        }
        return $path;
    }
613039
protected function locate_path($path) {
        $starturl = rtrim($this->getMinkParameter('base_url'), '/') . '/';
        return 0 !== strpos($path, 'http') ? $starturl . ltrim($path, '/') : $path;
    }
996142
public function getPathRelativeToDirectory($path)
    {
        // Get the last segment of the directory as asset paths will be relative to this
        // path. We can then replace this segment with nothing in the assets path.
        $directoryLastSegment = substr($this->path, strrpos($this->path, '/') + 1);

        return trim(preg_replace('/^'.$directoryLastSegment.'/', '', $path), '/');
    }
1113812
private function getPath($path)
    {
        $uri = parse_url($path);

        $stream = $this->getStreamByPathScheme($path);
        if ($stream instanceof StreamInterface) {
            foreach ($stream->getPaths() as $streamDomain => $streamPath) {
                if ($streamDomain === $uri['host']) {
                    $realPath = $this->getRealPath($uri, $streamPath);
                    if (strpos($realPath, $streamPath) === 0) {
                        return $realPath;
                    }
                }
            }
        }
    }
408241
public static function getUtilUrl($path)
    {
        global $CFG;
        if ( isset($CFG->utilroot) ) {
            return $CFG->utilroot.$path;
        }

        // From wwwroot
        $path = str_replace('.php','',$path);
        $retval = $CFG->wwwroot . '/util' . $path;
        return $retval;

        // The old way from "vendor"
        // return $CFG->vendorroot.$path;
    }
113749
public function extractWebspaceFromPath($path)
    {
        $match = preg_match('/^\/' . $this->getPath('base') . '\/([^\/]*)\/.*$/', $path, $matches);

        if ($match) {
            return $matches[1];
        } else {
            return;
        }
    }