/** * @dataProvider provideDetectServer * @covers WebRequest::detectServer * @covers WebRequest::detectProtocol */ public function testDetectServer($expected, $input, $description) { $this->setMwGlobals('wgAssumeProxiesUseDefaultProtocolPorts', true); $_SERVER = $input; $result = WebRequest::detectServer(); $this->assertEquals($expected, $result, $description); }
/** * @dataProvider provideDetectServer */ function testDetectServer($expected, $input, $description) { $oldServer = $_SERVER; $_SERVER = $input; $result = WebRequest::detectServer(); $_SERVER = $oldServer; $this->assertEquals($expected, $result, $description); }
* URL of the server. * * Example: * <code> * $wgServer = 'http://example.com'; * </code> * * This is usually detected correctly by MediaWiki. If MediaWiki detects the * wrong server, it will redirect incorrectly after you save a page. In that * case, set this variable to fix it. * * If you want to use protocol-relative URLs on your wiki, set this to a * protocol-relative URL like '//example.com' and set $wgCanonicalServer * to a fully qualified URL. */ $wgServer = WebRequest::detectServer(); /** * Canonical URL of the server, to use in IRC feeds and notification e-mails. * Must be fully qualified, even if $wgServer is protocol-relative. * * Defaults to $wgServer, expanded to a fully qualified http:// URL if needed. */ $wgCanonicalServer = false; /************************************************************************/ /** * @name Script path settings * @{ */ /** * The path we should point to. * It might be a virtual path in case with use apache mod_rewrite for example.
/** * Environment check for the server hostname. */ protected function envCheckServer($srv = null) { if ($srv) { // wgServer was pre-defined, perhaps by the cli installer $server = $srv; } else { $server = WebRequest::detectServer(); } $this->showMessage('config-using-server', $server); $this->setVar('wgServer', $server); }
protected function envGetDefaultServer() { return WebRequest::detectServer(); }
/** * Environment check for the server hostname. */ protected function envCheckServer() { $server = WebRequest::detectServer(); $this->showMessage('config-using-server', $server); $this->setVar('wgServer', $server); }