public static function usePath($path)
    {
        # Use the document root normally set via apache
        if ($path === self::PATH_DOCUMENT_ROOT) {
            if (empty($_SERVER["DOCUMENT_ROOT"]) || !is_dir($_SERVER["DOCUMENT_ROOT"])) {
                throw new \InvalidArgumentException("DOCUMENT_ROOT not defined");
            }
            static::$path = $_SERVER["DOCUMENT_ROOT"];
            return;
        }

        # Get the full path of the running script and use it's directory
        if ($path === self::PATH_PHP_SELF) {
            if (empty($_SERVER["PHP_SELF"]) || !$path = realpath($_SERVER["PHP_SELF"])) {
                throw new \InvalidArgumentException("PHP_SELF not defined");
            }
            static::$path = pathinfo($path, PATHINFO_DIRNAME);
            return;
        }

        # Calculate the parent of the vendor directory and use that
        if ($path === self::PATH_VENDOR_PARENT) {
            static::$path = realpath(__DIR__ . "/../../../..");
            return;
        }

        if (is_dir($path)) {
            static::$path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path specified");
        }
    }
public static function usePath($path)
    {
        # Use the document root normally set via apache
        if ($path === self::PATH_DOCUMENT_ROOT) {
            if (empty($_SERVER["DOCUMENT_ROOT"]) || !is_dir($_SERVER["DOCUMENT_ROOT"])) {
                throw new \InvalidArgumentException("DOCUMENT_ROOT not defined");
            }
            static::$path = $_SERVER["DOCUMENT_ROOT"];
            return;
        }

        # Get the full path of the running script and use it's directory
        if ($path === self::PATH_PHP_SELF) {
            if (empty($_SERVER["PHP_SELF"]) || !$path = realpath($_SERVER["PHP_SELF"])) {
                throw new \InvalidArgumentException("PHP_SELF not defined");
            }
            static::$path = pathinfo($path, PATHINFO_DIRNAME);
            return;
        }

        # Calculate the parent of the vendor directory and use that
        if ($path === self::PATH_VENDOR_PARENT) {
            static::$path = realpath(__DIR__ . "/../../../..");
            return;
        }

        if (is_dir($path)) {
            static::$path = $path;
        } else {
            throw new \InvalidArgumentException("Invalid path specified");
        }
    }
public static function usePath ( $ path ) { # Use the document root normally set via apache if ( $ path === self :: PATH_DOCUMENT_ROOT ) { if ( empty ( $ _SERVER [ "DOCUMENT_ROOT" ] ) || ! is_dir ( $ _SERVER [ "DOCUMENT_ROOT" ] ) ) { throw new \ InvalidArgumentException ( "DOCUMENT_ROOT not defined" ) ; } static :: $ path = $ _SERVER [ "DOCUMENT_ROOT" ] ; return ; } # Get the full path of the running script and use it's directory if ( $ path === self :: PATH_PHP_SELF ) { if ( empty ( $ _SERVER [ "PHP_SELF" ] ) || ! $ path = realpath ( $ _SERVER [ "PHP_SELF" ] ) ) { throw new \ InvalidArgumentException ( "PHP_SELF not defined" ) ; } static :: $ path = pathinfo ( $ path , PATHINFO_DIRNAME ) ; return ; } # Calculate the parent of the vendor directory and use that if ( $ path === self :: PATH_VENDOR_PARENT ) { static :: $ path = realpath ( __DIR__ . "/../../../.." ) ; return ; } if ( is_dir ( $ path ) ) { static :: $ path = $ path ; } else { throw new \ InvalidArgumentException ( "Invalid path specified" ) ; } }
Set the root path to use in the path methods.

@param int|string $path Either one of the PATH class constants or an actual path to a directory that exists, and is readable

@return void
Set the root path to use in the path methods .