src/Libs/Net.php
public static function getBasicPath() {
        $s = &$_SERVER;
        $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;
        $sp = strtolower($s['SERVER_PROTOCOL']);
        $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
        $port = $s['SERVER_PORT'];
        $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
        $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
        $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
        $uri = $protocol . '://' . $host;
        return $uri;
    }
public static function getBasicPath() {
        $s = &$_SERVER;
        $ssl = (!empty($s['HTTPS']) && $s['HTTPS'] == 'on') ? true : false;
        $sp = strtolower($s['SERVER_PROTOCOL']);
        $protocol = substr($sp, 0, strpos($sp, '/')) . (($ssl) ? 's' : '');
        $port = $s['SERVER_PORT'];
        $port = ((!$ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
        $host = isset($s['HTTP_X_FORWARDED_HOST']) ? $s['HTTP_X_FORWARDED_HOST'] : (isset($s['HTTP_HOST']) ? $s['HTTP_HOST'] : null);
        $host = isset($host) ? $host : $s['SERVER_NAME'] . $port;
        $uri = $protocol . '://' . $host;
        return $uri;
    }
public static function getBasicPath ( ) { $ s = & $ _SERVER ; $ ssl = ( ! empty ( $ s [ 'HTTPS' ] ) && $ s [ 'HTTPS' ] == 'on' ) ? true : false ; $ sp = strtolower ( $ s [ 'SERVER_PROTOCOL' ] ) ; $ protocol = substr ( $ sp , 0 , strpos ( $ sp , '/' ) ) . ( ( $ ssl ) ? 's' : '' ) ; $ port = $ s [ 'SERVER_PORT' ] ; $ port = ( ( ! $ ssl && $ port == '80' ) || ( $ ssl && $ port == '443' ) ) ? '' : ':' . $ port ; $ host = isset ( $ s [ 'HTTP_X_FORWARDED_HOST' ] ) ? $ s [ 'HTTP_X_FORWARDED_HOST' ] : ( isset ( $ s [ 'HTTP_HOST' ] ) ? $ s [ 'HTTP_HOST' ] : null ) ; $ host = isset ( $ host ) ? $ host : $ s [ 'SERVER_NAME' ] . $ port ; $ uri = $ protocol . '://' . $ host ; return $ uri ; }
Get basic path
@return string URL
Get basic path