src/Http.php
public static function getDocumentRoot() {
    if(null === self::$docRoot) {
      self::$docRoot = System::realPath($_SERVER['DOCUMENT_ROOT']);
      if(!self::$docRoot) {
        self::$docRoot = System::realPath(getcwd());
      }
    }
    return self::$docRoot;
  }
public static function getDocumentRoot() {
    if(null === self::$docRoot) {
      self::$docRoot = System::realPath($_SERVER['DOCUMENT_ROOT']);
      if(!self::$docRoot) {
        self::$docRoot = System::realPath(getcwd());
      }
    }
    return self::$docRoot;
  }
public static function getDocumentRoot ( ) { if ( null === self :: $ docRoot ) { self :: $ docRoot = System :: realPath ( $ _SERVER [ 'DOCUMENT_ROOT' ] ) ; if ( ! self :: $ docRoot ) { self :: $ docRoot = System :: realPath ( getcwd ( ) ) ; } } return self :: $ docRoot ; }
Returns the website's document root, if found, or current directory.
The path is always absolute.

@return string|NULL document root on success, FALSE otherwise
Returns the website s document root if found or current directory . The path is always absolute .