protected function calculateCurrentURL()
    {
        $url = "http";
        if ($this->isSecureConnection()) {
            $url .= 's://' . $_SERVER['SERVER_NAME'] . ('443' != $_SERVER['SERVER_PORT'] ? ':' . $_SERVER['SERVER_PORT'] : '');
        } else {
            $url .= '://' . $_SERVER['SERVER_NAME'] . ('80' != $_SERVER['SERVER_PORT'] ? ':' . $_SERVER['SERVER_PORT'] : '');
        }
        $this->host = $_SERVER['SERVER_NAME'];
        $this->currentDomain = $url . '/';
        $this->currentURL = $url . $_SERVER['REQUEST_URI'];
        if ($_SERVER['DOCUMENT_ROOT'][strlen($_SERVER['DOCUMENT_ROOT']) - 1] == '/') {
            $docRoot = substr($_SERVER['DOCUMENT_ROOT'], 0, strlen($_SERVER['DOCUMENT_ROOT']) - 1);
        } else {
            $docRoot = $_SERVER['DOCUMENT_ROOT'];
        }
        $secondPart = str_replace($docRoot, '', dirname($_SERVER['SCRIPT_FILENAME'])) . '/';
        $this->baseURL = $url . (('/' == $secondPart[0]) ? $secondPart : '/' . $secondPart);
    }
protected function calculateCurrentURL()
    {
        $url = "http";
        if ($this->isSecureConnection()) {
            $url .= 's://' . $_SERVER['SERVER_NAME'] . ('443' != $_SERVER['SERVER_PORT'] ? ':' . $_SERVER['SERVER_PORT'] : '');
        } else {
            $url .= '://' . $_SERVER['SERVER_NAME'] . ('80' != $_SERVER['SERVER_PORT'] ? ':' . $_SERVER['SERVER_PORT'] : '');
        }
        $this->host = $_SERVER['SERVER_NAME'];
        $this->currentDomain = $url . '/';
        $this->currentURL = $url . $_SERVER['REQUEST_URI'];
        if ($_SERVER['DOCUMENT_ROOT'][strlen($_SERVER['DOCUMENT_ROOT']) - 1] == '/') {
            $docRoot = substr($_SERVER['DOCUMENT_ROOT'], 0, strlen($_SERVER['DOCUMENT_ROOT']) - 1);
        } else {
            $docRoot = $_SERVER['DOCUMENT_ROOT'];
        }
        $secondPart = str_replace($docRoot, '', dirname($_SERVER['SCRIPT_FILENAME'])) . '/';
        $this->baseURL = $url . (('/' == $secondPart[0]) ? $secondPart : '/' . $secondPart);
    }
protected function calculateCurrentURL ( ) { $ url = "http" ; if ( $ this -> isSecureConnection ( ) ) { $ url .= 's://' . $ _SERVER [ 'SERVER_NAME' ] . ( '443' != $ _SERVER [ 'SERVER_PORT' ] ? ':' . $ _SERVER [ 'SERVER_PORT' ] : '' ) ; } else { $ url .= '://' . $ _SERVER [ 'SERVER_NAME' ] . ( '80' != $ _SERVER [ 'SERVER_PORT' ] ? ':' . $ _SERVER [ 'SERVER_PORT' ] : '' ) ; } $ this -> host = $ _SERVER [ 'SERVER_NAME' ] ; $ this -> currentDomain = $ url . '/' ; $ this -> currentURL = $ url . $ _SERVER [ 'REQUEST_URI' ] ; if ( $ _SERVER [ 'DOCUMENT_ROOT' ] [ strlen ( $ _SERVER [ 'DOCUMENT_ROOT' ] ) - 1 ] == '/' ) { $ docRoot = substr ( $ _SERVER [ 'DOCUMENT_ROOT' ] , 0 , strlen ( $ _SERVER [ 'DOCUMENT_ROOT' ] ) - 1 ) ; } else { $ docRoot = $ _SERVER [ 'DOCUMENT_ROOT' ] ; } $ secondPart = str_replace ( $ docRoot , '' , dirname ( $ _SERVER [ 'SCRIPT_FILENAME' ] ) ) . '/' ; $ this -> baseURL = $ url . ( ( '/' == $ secondPart [ 0 ] ) ? $ secondPart : '/' . $ secondPart ) ; }
Calculates current URL and returns it.
@return string
Calculates current URL and returns it .