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


PHP Host::getDefault方法代碼示例

本文整理匯總了PHP中Host::getDefault方法的典型用法代碼示例。如果您正苦於以下問題:PHP Host::getDefault方法的具體用法?PHP Host::getDefault怎麽用?PHP Host::getDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Host的用法示例。


在下文中一共展示了Host::getDefault方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Constructor.
  *
  * @param string $key
  *    See {@link getKey()}
  * @param string $secret
  *    See {@link getSecret()}
  */
 function __construct($key, $secret)
 {
     self::checkKeyArg($key);
     self::checkSecretArg($secret);
     $this->key = $key;
     $this->secret = $secret;
     // The $host parameter is sort of internal.  We don't include it in the param list because
     // we don't want it to be included in the documentation.  Use PHP arg list hacks to get at
     // it.
     $host = null;
     if (\func_num_args() == 3) {
         $host = \func_get_arg(2);
         Host::checkArgOrNull("host", $host);
     }
     if ($host === null) {
         $host = Host::getDefault();
     }
     $this->host = $host;
 }
開發者ID:Radiergummi,項目名稱:anacronism,代碼行數:27,代碼來源:AppInfo.php

示例2: __construct

 /**
  * Constructor.
  *
  * @param string $accessToken
  *     See {@link getAccessToken()}
  * @param string $clientIdentifier
  *     See {@link getClientIdentifier()}
  * @param null|string $userLocale
  *     See {@link getUserLocale()}
  */
 function __construct($accessToken, $clientIdentifier, $userLocale = null)
 {
     self::checkAccessTokenArg("accessToken", $accessToken);
     self::checkClientIdentifierArg("clientIdentifier", $clientIdentifier);
     Checker::argStringNonEmptyOrNull("userLocale", $userLocale);
     $this->accessToken = $accessToken;
     $this->clientIdentifier = $clientIdentifier;
     $this->userLocale = $userLocale;
     // The $host parameter is sort of internal.  We don't include it in the param list because
     // we don't want it to be included in the documentation.  Use PHP arg list hacks to get at
     // it.
     $host = null;
     if (\func_num_args() == 4) {
         $host = \func_get_arg(3);
         Host::checkArgOrNull("host", $host);
     }
     if ($host === null) {
         $host = Host::getDefault();
     }
     $this->host = $host;
     // These fields are redundant, but it makes these values a little more convenient
     // to access.
     $this->apiHost = $host->getApi();
     $this->contentHost = $host->getContent();
 }
開發者ID:themexpand,項目名稱:xpand-buddy,代碼行數:35,代碼來源:Client.php


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