protected function realPath($path)
    {
        if (php_sapi_name() == 'cli' && ! $path) {
            $path = $_SERVER['DOCUMENT_ROOT'];
        }

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

        return rtrim($path, '/\\');
    }
protected function realPath($path)
    {
        if (php_sapi_name() == 'cli' && ! $path) {
            $path = $_SERVER['DOCUMENT_ROOT'];
        }

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

        return rtrim($path, '/\\');
    }
protected function realPath ( $ path ) { if ( php_sapi_name ( ) == 'cli' && ! $ path ) { $ path = $ _SERVER [ 'DOCUMENT_ROOT' ] ; } if ( $ realPath = realpath ( $ path ) ) { $ path = $ realPath ; } return rtrim ( $ path , '/\\' ) ; }
Takes a path and transforms it to a real path.

@param  string  $path
@return string
Takes a path and transforms it to a real path .