protected function getUrlPath($path, $exitsFile = false): string
    {
        $this->checkRoot();

        $path = $this->cleanPathInternal($path);
        if ($this->isVirtual($path)) {
            $path = $this->get($path);
        }

        $subject = $path;
        $pattern = '/^' . preg_quote($this->root, '/') . '/i';

        if ($exitsFile && !$this->isVirtual($path) && !file_exists($path)) {
            $subject = null;
        }

        return ltrim(preg_replace($pattern, '', $subject), '/');
    }
protected function getUrlPath($path, $exitsFile = false): string
    {
        $this->checkRoot();

        $path = $this->cleanPathInternal($path);
        if ($this->isVirtual($path)) {
            $path = $this->get($path);
        }

        $subject = $path;
        $pattern = '/^' . preg_quote($this->root, '/') . '/i';

        if ($exitsFile && !$this->isVirtual($path) && !file_exists($path)) {
            $subject = null;
        }

        return ltrim(preg_replace($pattern, '', $subject), '/');
    }
protected function getUrlPath ( $ path , $ exitsFile = false ) : string { $ this -> checkRoot ( ) ; $ path = $ this -> cleanPathInternal ( $ path ) ; if ( $ this -> isVirtual ( $ path ) ) { $ path = $ this -> get ( $ path ) ; } $ subject = $ path ; $ pattern = '/^' . preg_quote ( $ this -> root , '/' ) . '/i' ; if ( $ exitsFile && ! $ this -> isVirtual ( $ path ) && ! file_exists ( $ path ) ) { $ subject = null ; } return ltrim ( preg_replace ( $ pattern , '' , $ subject ) , '/' ) ; }
Get url path.

@param string $path (example: "default:file.txt" or "C:/Server/public_html/index.php")
@param bool   $exitsFile
@return string
@throws Exception
Get url path .