private function findDocumentRootInScriptFileName()
    {

        $filename = $this->server->get('SCRIPT_FILENAME') ?: false;
        if (false === $filename) {
            return false;
        }
        $parse = explode('/', $filename);
        $count = count($parse);
        if ($count && $count > 1) {
            $path = array_slice($parse, 0, $count-1);
            return $this->removeLastSlash(join('/', $path));
        } else {
            return '/';
        }

    }
private function findDocumentRootInScriptFileName()
    {

        $filename = $this->server->get('SCRIPT_FILENAME') ?: false;
        if (false === $filename) {
            return false;
        }
        $parse = explode('/', $filename);
        $count = count($parse);
        if ($count && $count > 1) {
            $path = array_slice($parse, 0, $count-1);
            return $this->removeLastSlash(join('/', $path));
        } else {
            return '/';
        }

    }
private function findDocumentRootInScriptFileName ( ) { $ filename = $ this -> server -> get ( 'SCRIPT_FILENAME' ) ? : false ; if ( false === $ filename ) { return false ; } $ parse = explode ( '/' , $ filename ) ; $ count = count ( $ parse ) ; if ( $ count && $ count > 1 ) { $ path = array_slice ( $ parse , 0 , $ count - 1 ) ; return $ this -> removeLastSlash ( join ( '/' , $ path ) ) ; } else { return '/' ; } }
find document root in server script filename

@return bool|string
find document root in server script filename