本文整理汇总了PHP中WebRequest::detectServer方法的典型用法代码示例。如果您正苦于以下问题:PHP WebRequest::detectServer方法的具体用法?PHP WebRequest::detectServer怎么用?PHP WebRequest::detectServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest::detectServer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDetectServer
/**
* @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);
}
示例2: testDetectServer
/**
* @dataProvider provideDetectServer
*/
function testDetectServer($expected, $input, $description)
{
$oldServer = $_SERVER;
$_SERVER = $input;
$result = WebRequest::detectServer();
$_SERVER = $oldServer;
$this->assertEquals($expected, $result, $description);
}
示例3:
* 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.
示例4: envCheckServer
/**
* 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);
}
示例5: envGetDefaultServer
protected function envGetDefaultServer()
{
return WebRequest::detectServer();
}
示例6: envCheckServer
/**
* Environment check for the server hostname.
*/
protected function envCheckServer()
{
$server = WebRequest::detectServer();
$this->showMessage('config-using-server', $server);
$this->setVar('wgServer', $server);
}