@param string $path

@return string
558799
public function globalComponentsPath( $path ) {
		$dir = $this->getLockDir( false ) . '/global-components/';
		if ( file_exists( $dir ) ) {
			return $dir;
		} else {
			return $path;
		}
	}
1202267
protected function _relpath($path) {
		return $path == $this->root ? '' : substr($path, strlen($this->root)+1);
	}
1344369
public static function slashPath($path) {
		if (UString::startswith ( $path, "/" ) === false)
			$path = "/" . $path;
		if (! UString::endswith ( $path, "/" ))
			$path = $path . "/";
		return $path;
	}
119912
protected function makeDirectory($path): string
    {
        if (! $this->laravel['files']->isDirectory($path)) {
            $this->laravel['files']->makeDirectory($path, 0777, true, true);
        }

        return $path;
    }
833143
public function normalizePath($path)
    {
        $realpath = realpath($path);
        if ($realpath) {
            $path = $realpath;
        }

        $path = str_replace('\\', '/', $path);
        $path = rtrim($path, '/');
        if (substr($path, 1, 1) === ':') {
            $path = lcfirst($path);
        }

        return $path;
    }
1164392
protected static function _realpath($path)
    {
        $realPath = realpath($path);
        if ($realPath !== false) {
            $path = $realPath;
        }

        return rtrim($path, '/\\');
    }
87538
static public function urlToPath($path)
    {
        $path = parse_url($path);
        return $path === null ? null : str_replace('/', DIRECTORY_SEPARATOR, $path['path']);
    }
20630
public function normalizePath($path)
    {
        $path = trim($path);

        $path = str_replace(DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path);

        if (ends_with($path, DIRECTORY_SEPARATOR)) {
            $path = substr($path, 0, -1);
        }

        return $path;
    }
207064
private function cleanPath($path)
	{
		$path = str_replace('/', $this->DS, $path);
		$path = str_replace('\\', $this->DS, $path);
		$path = preg_replace('#' . $this->DS . '+#', $this->DS, $path);

		return $path;
	}
729241
public static function pathToRel($path): string
    {
        $root = FS::clean(Vars::get($_SERVER['DOCUMENT_ROOT']));
        $path = FS::clean($path);

        $normRoot = str_replace(DIRECTORY_SEPARATOR, '/', $root);
        $normPath = str_replace(DIRECTORY_SEPARATOR, '/', $path);

        $regExp = '/^' . preg_quote($normRoot, '/') . '/i';
        $relative = preg_replace($regExp, '', $normPath);

        $relative = ltrim($relative, '/');

        return $relative;
    }
1252945
protected function filterPath($path)
    {
        $path = preg_replace_callback(
            '/(?:[^' . self::CHARACTERS_UNRESERVED . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
            function ($match) {
                return rawurlencode($match[0]);
            },
            $path
        );

        if (empty($path)) {
            return $path;
        }

        if (substr($path, 0, 1) !== '/') {
            return $path;
        } else {
            return '/' . ltrim($path, '/');
        }
    }
904030
protected function realpath(string $path): string
    {
        if ($path === '') {
            return $this->baseDir;
        }

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

        return $this->baseDir . '/' . $path;
    }
760816
protected function makeSurePathIsAbsolute($path): string
    {
        $site_url = rtrim($this->getParameter('site_url'), '/') . '/';

        if (0 !== strpos($path, 'http')) {
            return $site_url . ltrim($path, '/');
        } else {
            return $path;
        }
    }
664554
protected function path($path)
    {
        if (strpos($path, './') === 0) {
            return $this->dir . '/' . substr($path, 2);
        }

        if (strpos($path, '../') === 0) {
            return dirname($this->dir) . '/' . substr($path, 3);
        }

        return $path;
    }
155402
private function normalize(string $path): string
    {
        if ($path === '') {
            return '/';
        }

        if (strlen($path) > 1) {
            if ($this->trailingSlash) {
                if (substr($path, -1) !== '/' && !pathinfo($path, PATHINFO_EXTENSION)) {
                    return $path.'/';
                }
            } else {
                return rtrim($path, '/');
            }
        }

        return $path;
    }
1130600
public function read(string $path): string
    {
        $location = $this->applyBasePath($path);
        $content  = file_get_contents($location);

        unset($location);

        return $content;
    }
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);
    }