OneLogin_Saml2_Utils::getSelfURLhost PHP 메소드

getSelfURLhost() 공개 정적인 메소드

Returns the protocol + the current host + the port (if different than common ports).
public static getSelfURLhost ( ) : string
리턴 string $url
    public static function getSelfURLhost()
    {
        $currenthost = self::getSelfHost();
        $port = '';
        if (self::isHTTPS()) {
            $protocol = 'https';
        } else {
            $protocol = 'http';
        }
        $portnumber = self::getSelfPort();
        if (isset($portnumber) && $portnumber != '80' && $portnumber != '443') {
            $port = ':' . $portnumber;
        }
        return $protocol . "://" . $currenthost . $port;
    }

Usage Example

예제 #1
0
 /**
  * Tests the getSelfRoutedURLNoQuery method of the OneLogin_Saml2_Utils
  *
  * @covers OneLogin_Saml2_Utils::getSelfRoutedURLNoQuery
  */
 public function getSelfRoutedURLNoQuery()
 {
     $url = OneLogin_Saml2_Utils::getSelfURLhost();
     $_SERVER['REQUEST_URI'] = 'example1/route?x=test';
     $_SERVER['QUERY_STRING'] = '?x=test';
     $url .= 'example1/route';
     $this->assertEquals($url, OneLogin_Saml2_Utils::getSelfRoutedURLNoQuery());
 }
All Usage Examples Of OneLogin_Saml2_Utils::getSelfURLhost