protected function getServerInfo() { static $scheme_ports = array('http' => 80, 'https' => 443, 'telnet' => 23); WebserverDefaults::setServerURL(); $url = WebserverDefaults::getServerURL(); if (!empty($url)) { $info = parse_url($url); if (isset($info['scheme']) && array_key_exists($info['scheme'], $scheme_ports) && !isset($info['port'])) { $info['port'] = $scheme_ports[$info['scheme']]; } } else { $info = array(); } return $info; }
/** * A support method which delivers the URL (with scheme and authority as per RFC3986) to the targeted test site, * where the default test site is assumed to be the URL as provided by @see WebserverDefaults::getServerUrl(), * which can be overridden by specifying a different URL through the setServerUrl() method. * * @param string $auth_str The optional userinfo (cf. RFC3986 section 3.2) part of the URI. * @param string $path The optional relative path to the previously configured 'server URL'. * @return string The URL as currently configured. * @access public */ function getServerUrl($auth_str = null, $path = null) { if (empty($this->server_url)) { $url = WebserverDefaults::getServerURL($auth_str); $this->server_url = $url; } else { $url = $this->server_url; } return WebserverDefaults::completeURL($path, $url, $auth_str); }