Пример #1
0
 /**
  * Returns the applications host address.
  *
  * @return String
  */
 public static function getHostUri()
 {
     $sheme = self::getHostParam("HTTPS") == "on" ? "https" : "http";
     $serverName = new String(self::getHostParam("HTTP_HOST"));
     $serverPort = self::getHostParam("SERVER_PORT");
     $serverPort = $serverPort != 80 && $serverPort != 443 ? ":" . $serverPort : "";
     if ($serverName->endsWith($serverPort)) {
         $serverName = $serverName->replace($serverPort, "");
     }
     return new String($sheme . "://" . $serverName . $serverPort);
 }