public static function current($env = false)
    {
        if ($env || (false === ($cwd = getcwd()))) {
            if (isset($_SERVER['PWD'])) {
                $cwd = $_SERVER['PWD'];
            } elseif (isset($_SERVER['CD'])) {
                $cwd = $_SERVER['CD'];
            } else {
                throw new PathException('The current working directory path could not be found.');
            }
        }

        return $cwd;
    }
public static function current($env = false)
    {
        if ($env || (false === ($cwd = getcwd()))) {
            if (isset($_SERVER['PWD'])) {
                $cwd = $_SERVER['PWD'];
            } elseif (isset($_SERVER['CD'])) {
                $cwd = $_SERVER['CD'];
            } else {
                throw new PathException('The current working directory path could not be found.');
            }
        }

        return $cwd;
    }
public static function current ( $ env = false ) { if ( $ env || ( false === ( $ cwd = getcwd ( ) ) ) ) { if ( isset ( $ _SERVER [ 'PWD' ] ) ) { $ cwd = $ _SERVER [ 'PWD' ] ; } elseif ( isset ( $ _SERVER [ 'CD' ] ) ) { $ cwd = $ _SERVER [ 'CD' ] ; } else { throw new PathException ( 'The current working directory path could not be found.' ) ; } } return $ cwd ; }
Returns the current working directory path.

The `getcwd()` function may return `false` if the parent of the current
working directory is not readable. To workaround this issue, this method
will check environment variables that may be set by the operating system
for the current path.

@param boolean $env Only use the environment variables?

@return string The current working directory path.

@throws Exception
@throws PathException If the path could not be found.
Returns the current working directory path .