Return the full web path to a file.

@param $path

@return string
181559
public function fileWebpath($path)
    {
        $path = $this->disk->url($path);
        // Remove extra slashes from URL without removing first two slashes after http/https:...
        $path = preg_replace('/([^:])(\/{2,})/', '$1/', $path);

        return $path;
    }
787325
public function getPath(string $path = ''): string
    {
        return $this->dirPath.($path ? DIRECTORY_SEPARATOR.$path : $path);
    }
243102
protected function urlFromRoute($path = '')
    {
        $url = $this->baseURL;
        $url[] = $path;
        if (!empty($this->page)) $url[] = '?page=' . $this->page;
        return implode('', $url);
    }
984384
private function _getJsonPath($path) 
    {
        $url = $this->_baseURI;
        $path = ltrim($path, '/');
        $auth = ($this->_isAuthInPath()) ? $this->_token : '';
        $pathConfiguration = ($this->_isPathConfiguration()) ? $this->_pathConfiguration : '/';
        return $url . $path . $pathConfiguration . $auth;
    }
1018486
public function normalizeDirectoryPath($path)
    {
        $path = $this->normalizePath($path);

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

        return $path;
    }
1327718
private static function load($path)
    {
        $path = str_replace('.', '/', $path);

        $path = FULL_PATH . $path;

        if(substr($path, -4) != '.php')
        {
            $path = $path . '.php';
        }

        return $path;
    }
799758
private function asPath($path)
    {
        $expr = explode(";", $path);
        $fullPath = "$";
        for ($i = 1, $n = count($expr); $i < $n; $i++) {
            $fullPath .= preg_match("/^[0-9*]+$/", $expr[$i]) ? ("[" . $expr[$i] . "]") : ("['" . $expr[$i] . "']");
        }

        return $fullPath;
    }
326287
public function sharedGet(string $path) : string
    {
        $contents = '';
        $handle   = @fopen($path, File::READ_BINARY);

        if (false === $handle) {
            return $contents;
        }

        try {
            if (flock($handle, LOCK_SH)) {
                clearstatcache(true, $path);

                $contents = fread($handle, filesize($path) ?: 1);

                flock($handle, LOCK_UN);
            }
        } finally {
            fclose($handle);
        }

        return $contents;
    }
481208
private function getPhpFilesFromPath(string $path)
    {
        $directoryIterator = new RecursiveDirectoryIterator($path);
        foreach (new RecursiveIteratorIterator($directoryIterator) as $file) {
            if (! in_array($file->getExtension(), $this->fileExtensions)) {
                continue;
            }

            if ($this->fileShouldBeIgnored($file)) {
                continue;
            }

            $this->files->push(new File(['displayPath' => $file->getPathName(), 'fullPath' => $file->getRealPath()]));
        }
    }
1343618
protected function _getRelDir($path) {
        $filename = basename($path);
        $dir = substr($path, 0, strlen($path) - strlen($filename));
        return $dir;
    }
370075
public function getFile($path)
    {
        $file = new File($this->getFileSystemId(), $this->getFullPath($path));
        $file->setServiceLocator($this->getServiceLocator());
        return $file;
    }
48939
public function Path($Path = NULL) {
      if (is_string($Path)) {
         $Result = $this->_ParsedRequestElement('Path', $Path);
      } else {
         $Result = $this->_ParsedRequestElement('Path');
         if ($Path === TRUE) {
            // Encode the path.
            $Parts = explode('/', $Result);
            $Parts = array_map('urlencode', $Parts);
            $Result = implode('/', $Parts);
         }
      }
      
      return $Result;
   }
1001223
public function getAbsolutePath($path)
    {
        if (DIRECTORY_SEPARATOR === '\\') {
            if (preg_match('/^(?>[a-zA-Z]:\\\\|\\\\\\\\)/', $path) !== 1) {
                $path = $this->getRootDir() . $path;
            }
        } else {
            if ($path[0] !== '/') {
                $path = $this->getRootDir() . $path;
            }
        }
        return rtrim($path, '/\\') . '/';
    }
1153038
public function getUrl($path)
    {
        $path = ltrim($path, "/");
        $url = '';
        if ($this->isFile($path)) $url = $this->host.$path;

        return $url;
    }
1118513
public function getContents($path)
    {
        $fullPath = $this->concatPaths($path);

        if (file_exists($fullPath)) {
            return file_get_contents($fullPath);
        }

        return false;
    }
792091
public function rootPath($path = '')
    {
        if (defined('THEMOSIS_ROOT')) {
            return THEMOSIS_ROOT.($path ? DIRECTORY_SEPARATOR.$path : $path);
        }

        return $this->webPath($path);
    }
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;
    }