Translate path alias into a actual path or build path.
Return absolute path.

@param string $path Path to the file

@return mixed|string
971238
public function path($path)
    {
        $path  = strtolower(trim($path));
        $first = substr($path, 0, 1);
        
        if ($first == '@' && isset($this->aliases[$path])) {
            $path = $this->aliases[$path];
            
        } elseif ($first == '/') {
            $path = preg_replace('/\\//', $this->root() . '/', $path, 1);
            
        }
        if ($path = realpath($path)) {
            $path = static::clean($path);
        }
        
        return $path;
    }
884337
protected function _relpath($path) {
	
		
		$newpath = $path;
		
		
		if (substr($path, 0, 1) != '/') {
			$newpath = "/$newpath";
		}
		
		$newpath =  preg_replace("/\/$/", "", $newpath);
	
		$ret = ($newpath == $this->root) ? '' : substr($newpath, strlen($this->root)+1);
		
		return $ret;
	}
554953
protected function _findPath($path)
    {
        $path = $this->_unifyPath($path);
        $dirs = $this->_dirs;

        $file = null;

        foreach ($dirs as $dir) {
            if (is_readable(realpath($dir.DS.$path))) {
                $file = $dir.DS.$path;
                break;
            }
        }

        return $file;
    }
1018828
private function formatPath($path) {
	if($this->dynamic_fileroot != '') {
		$a = explode($this->separator, $path);
		return end($a);
	} else {
		return $path;
	}
}
376795
private function realPath($path) {
        $tpls    = explode('/', $path);
        $tpls[0] = App::id2dir($tpls[0]);
        $tpl     = implode('/', $tpls);

        return $tpl;
    }
735960
protected function resolvePath($path)
    {
        $newPath  = [];
        foreach (explode('/', $path) as $pathPart) {
            if ('.' !== $pathPart) {
                if ('..' !== $pathPart) {
                    $newPath[] = $pathPart;
                } else {
                    array_pop($newPath);
                }
            }
        }

        return implode('/', $newPath);
    }
601517
private function normalizePath($path)
    {
        $path = str_replace(\DIRECTORY_SEPARATOR, '/', $path);
        if ('/' !== $path[0]) {
            $path = getcwd() . '/' . $path;
        }

        return $path;
    }
108646
protected function _abspath($path) {
		return $path == DIRECTORY_SEPARATOR ? $this->root : $this->root.DIRECTORY_SEPARATOR.$path;
	}
1265177
public function getRealPath($path)
    {
        $existentPath = $this->normalizePath($path);
        $tail = [];

        $pathArray = explode('/', $existentPath);
        while (!file_exists($existentPath)) {
            array_unshift($tail, array_pop($pathArray));
            $existentPath = implode('/', $pathArray);
        }

        return str_replace(
            \DIRECTORY_SEPARATOR,
            '/',
            $existentPath . '/' . implode(\DIRECTORY_SEPARATOR, $tail)
        );
    }
1018486
public function normalizeDirectoryPath($path)
    {
        $path = $this->normalizePath($path);

        if (is_link($path)) {
            $path = realpath($path);
        }

        return $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);
    }
1333361
private function relativizePaths($path)
    {
        if (!$this->basePath) {
            return $path;
        }

        return str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
    }
924588
protected function realpath($path)
    {
        if ($path === '') {
            return $this->baseDir;
        }

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

        return $this->baseDir . '/' . $path;
    }
841748
public function basePath($path = '')
    {
        return $this->getFilesystem()->dirname($this->path()) . ($path ? DIRECTORY_SEPARATOR . $path : $path);
    }
740917
protected function makePath($path)
    {
        $path = $this->fs->isAbsolutePath($path)
            ? $path
            : base_path($path);
        return Paths::fix($path);
    }
255878
public function pathToEntity($path)
    {
        return is_dir($path) ? new FileSystem\Directory($path) : new FileSystem\File($path);
    }
644839
protected function makePath($path)
    {
        return $this->context->directory ? $this->context->directory.'/'.$path : $path;
    }