src/Gzfextra/EasyMvc/Http/Request.php
protected function detectBasePath()
    {
        $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
        $baseUrl  = $this->getBaseUrl();

        // Empty base url detected
        if ($baseUrl === '') {
            return '';
        }

        // basename() matches the script filename; return the directory
        if (basename($baseUrl) === $filename) {
            return str_replace('\\', '/', dirname($baseUrl));
        }

        // Base path is identical to base URL
        return $baseUrl;
    }
protected function detectBasePath()
    {
        $filename = basename($this->getServer()->get('SCRIPT_FILENAME', ''));
        $baseUrl  = $this->getBaseUrl();

        // Empty base url detected
        if ($baseUrl === '') {
            return '';
        }

        // basename() matches the script filename; return the directory
        if (basename($baseUrl) === $filename) {
            return str_replace('\\', '/', dirname($baseUrl));
        }

        // Base path is identical to base URL
        return $baseUrl;
    }
protected function detectBasePath ( ) { $ filename = basename ( $ this -> getServer ( ) -> get ( 'SCRIPT_FILENAME' , '' ) ) ; $ baseUrl = $ this -> getBaseUrl ( ) ; // Empty base url detected if ( $ baseUrl === '' ) { return '' ; } // basename() matches the script filename; return the directory if ( basename ( $ baseUrl ) === $ filename ) { return str_replace ( '\\' , '/' , dirname ( $ baseUrl ) ) ; } // Base path is identical to base URL return $ baseUrl ; }
Autodetect the base path of the request

Uses several criteria to determine the base path of the request.

@return string
Autodetect the base path of the request