Pagekit\Filesystem\Filesystem::getPathInfo PHP Method

getPathInfo() public method

Gets file path info.
public getPathInfo ( string $file, string $option = null ) : string | array
$file string
$option string
return string | array
    public function getPathInfo($file, $option = null)
    {
        $info = Path::parse($file);
        if ($info['protocol'] != 'file') {
            $info['url'] = $info['pathname'];
        }
        if ($adapter = $this->getAdapter($info['protocol'])) {
            $info = $adapter->getPathInfo($info);
        }
        if ($option === null) {
            return $info;
        }
        return array_key_exists($option, $info) ? $info[$option] : '';
    }