public function getScriptUrl()
    {
        if ($this->_scriptUrl === null) {
            $scriptFile = $this->getScriptFile();
            $scriptName = basename($scriptFile);
            $serverParams = $this->getServerParams();
            if (isset($serverParams['SCRIPT_NAME']) && basename($serverParams['SCRIPT_NAME']) === $scriptName) {
                $this->_scriptUrl = $serverParams['SCRIPT_NAME'];
            } elseif (isset($serverParams['PHP_SELF']) && basename($serverParams['PHP_SELF']) === $scriptName) {
                $this->_scriptUrl = $serverParams['PHP_SELF'];
            } elseif (isset($serverParams['ORIG_SCRIPT_NAME']) && basename($serverParams['ORIG_SCRIPT_NAME']) === $scriptName) {
                $this->_scriptUrl = $serverParams['ORIG_SCRIPT_NAME'];
            } elseif (isset($serverParams['PHP_SELF']) && ($pos = strpos($serverParams['PHP_SELF'], '/' . $scriptName)) !== false) {
                $this->_scriptUrl = substr($serverParams['SCRIPT_NAME'], 0, $pos) . '/' . $scriptName;
            } elseif (!empty($serverParams['DOCUMENT_ROOT']) && strpos($scriptFile, $serverParams['DOCUMENT_ROOT']) === 0) {
                $this->_scriptUrl = str_replace([$serverParams['DOCUMENT_ROOT'], '\\'], ['', '/'], $scriptFile);
            } else {
                throw new InvalidConfigException('Unable to determine the entry script URL.');
            }
        }

        return $this->_scriptUrl;
    }
public function getScriptUrl()
    {
        if ($this->_scriptUrl === null) {
            $scriptFile = $this->getScriptFile();
            $scriptName = basename($scriptFile);
            $serverParams = $this->getServerParams();
            if (isset($serverParams['SCRIPT_NAME']) && basename($serverParams['SCRIPT_NAME']) === $scriptName) {
                $this->_scriptUrl = $serverParams['SCRIPT_NAME'];
            } elseif (isset($serverParams['PHP_SELF']) && basename($serverParams['PHP_SELF']) === $scriptName) {
                $this->_scriptUrl = $serverParams['PHP_SELF'];
            } elseif (isset($serverParams['ORIG_SCRIPT_NAME']) && basename($serverParams['ORIG_SCRIPT_NAME']) === $scriptName) {
                $this->_scriptUrl = $serverParams['ORIG_SCRIPT_NAME'];
            } elseif (isset($serverParams['PHP_SELF']) && ($pos = strpos($serverParams['PHP_SELF'], '/' . $scriptName)) !== false) {
                $this->_scriptUrl = substr($serverParams['SCRIPT_NAME'], 0, $pos) . '/' . $scriptName;
            } elseif (!empty($serverParams['DOCUMENT_ROOT']) && strpos($scriptFile, $serverParams['DOCUMENT_ROOT']) === 0) {
                $this->_scriptUrl = str_replace([$serverParams['DOCUMENT_ROOT'], '\\'], ['', '/'], $scriptFile);
            } else {
                throw new InvalidConfigException('Unable to determine the entry script URL.');
            }
        }

        return $this->_scriptUrl;
    }
public function getScriptUrl ( ) { if ( $ this -> _scriptUrl === null ) { $ scriptFile = $ this -> getScriptFile ( ) ; $ scriptName = basename ( $ scriptFile ) ; $ serverParams = $ this -> getServerParams ( ) ; if ( isset ( $ serverParams [ 'SCRIPT_NAME' ] ) && basename ( $ serverParams [ 'SCRIPT_NAME' ] ) === $ scriptName ) { $ this -> _scriptUrl = $ serverParams [ 'SCRIPT_NAME' ] ; } elseif ( isset ( $ serverParams [ 'PHP_SELF' ] ) && basename ( $ serverParams [ 'PHP_SELF' ] ) === $ scriptName ) { $ this -> _scriptUrl = $ serverParams [ 'PHP_SELF' ] ; } elseif ( isset ( $ serverParams [ 'ORIG_SCRIPT_NAME' ] ) && basename ( $ serverParams [ 'ORIG_SCRIPT_NAME' ] ) === $ scriptName ) { $ this -> _scriptUrl = $ serverParams [ 'ORIG_SCRIPT_NAME' ] ; } elseif ( isset ( $ serverParams [ 'PHP_SELF' ] ) && ( $ pos = strpos ( $ serverParams [ 'PHP_SELF' ] , '/' . $ scriptName ) ) !== false ) { $ this -> _scriptUrl = substr ( $ serverParams [ 'SCRIPT_NAME' ] , 0 , $ pos ) . '/' . $ scriptName ; } elseif ( ! empty ( $ serverParams [ 'DOCUMENT_ROOT' ] ) && strpos ( $ scriptFile , $ serverParams [ 'DOCUMENT_ROOT' ] ) === 0 ) { $ this -> _scriptUrl = str_replace ( [ $ serverParams [ 'DOCUMENT_ROOT' ] , '\\' ] , [ '' , '/' ] , $ scriptFile ) ; } else { throw new InvalidConfigException ( 'Unable to determine the entry script URL.' ) ; } } return $ this -> _scriptUrl ; }
Returns the relative URL of the entry script.
The implementation of this method referenced Zend_Controller_Request_Http in Zend Framework.
@return string the relative URL of the entry script.
@throws InvalidConfigException if unable to determine the entry script URL
Returns the relative URL of the entry script . The implementation of this method referenced Zend_Controller_Request_Http in Zend Framework .