当前位置: 首页>>代码示例>>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;未经允许,请勿转载。