當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WebRequest::detectServer方法代碼示例

本文整理匯總了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);
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:12,代碼來源:WebRequestTest.php

示例2: testDetectServer

 /**
  * @dataProvider provideDetectServer
  */
 function testDetectServer($expected, $input, $description)
 {
     $oldServer = $_SERVER;
     $_SERVER = $input;
     $result = WebRequest::detectServer();
     $_SERVER = $oldServer;
     $this->assertEquals($expected, $result, $description);
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:11,代碼來源:WebRequestTest.php

示例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.
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:31,代碼來源:DefaultSettings.php

示例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);
 }
開發者ID:eFFemeer,項目名稱:seizamcore,代碼行數:14,代碼來源:Installer.php

示例5: envGetDefaultServer

 protected function envGetDefaultServer()
 {
     return WebRequest::detectServer();
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:4,代碼來源:WebInstaller.php

示例6: envCheckServer

 /**
  * Environment check for the server hostname.
  */
 protected function envCheckServer()
 {
     $server = WebRequest::detectServer();
     $this->showMessage('config-using-server', $server);
     $this->setVar('wgServer', $server);
 }
開發者ID:namrenni,項目名稱:mediawiki,代碼行數:9,代碼來源:Installer.php


注:本文中的WebRequest::detectServer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。