当前位置: 首页>>代码示例>>PHP>>正文


PHP ClientInterface::getLogger方法代码示例

本文整理汇总了PHP中Guzzle\Http\ClientInterface::getLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP ClientInterface::getLogger方法的具体用法?PHP ClientInterface::getLogger怎么用?PHP ClientInterface::getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Guzzle\Http\ClientInterface的用法示例。


在下文中一共展示了ClientInterface::getLogger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: factory

 /**
  * Factory method which allows for easy service creation
  *
  * @param  ClientInterface $client
  * @return self
  */
 public static function factory(ClientInterface $client)
 {
     $identity = new self();
     if (($client instanceof Base || $client instanceof OpenStack) && $client->hasLogger()) {
         $identity->setLogger($client->getLogger());
     }
     $identity->setClient($client);
     $identity->setEndpoint(clone $client->getAuthUrl());
     return $identity;
 }
开发者ID:skinnard,项目名称:FTL-2,代码行数:16,代码来源:Service.php

示例2: factory

 /**
  * Factory method which allows for easy service creation
  *
  * @param  ClientInterface $client
  * @return self
  */
 public static function factory(\Guzzle\Http\ClientInterface $client)
 {
     $tempAuth = new self();
     if (($client instanceof \OpenCloud\Common\Base || $client instanceof \OpenCloud\OpenStack) && $client->hasLogger()) {
         $tempAuth->setLogger($client->getLogger());
     }
     $tempAuth->setClient($client);
     $tempAuth->setEndpoint(clone $client->getAuthUrl());
     return $tempAuth;
 }
开发者ID:fia-net,项目名称:openstack-tempauth,代码行数:16,代码来源:TempAuth.php

示例3: __construct

 /**
  * Creates a service object, based off the specified client.
  *
  * The service's URL is defined in the client's serviceCatalog; it
  * uses the $type, $name, $region, and $urlType to find the proper endpoint
  * and set it. If it cannot find a URL in the service catalog that matches
  * the criteria, then an exception is thrown.
  *
  * @param Client $client  Client object
  * @param string $type    Service type (e.g. 'compute')
  * @param string $name    Service name (e.g. 'cloudServersOpenStack')
  * @param string $region  Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD' or 'HKG')
  * @param string $urlType Either 'publicURL' or 'internalURL'
  */
 public function __construct(ClientInterface $client, $type = null, $name = null, $region = null, $urlType = null)
 {
     if (($client instanceof Base || $client instanceof OpenStack) && $client->hasLogger()) {
         $this->setLogger($client->getLogger());
     }
     $this->setClient($client);
     $this->name = $name ?: static::DEFAULT_NAME;
     $this->region = $region;
     $this->region = $region;
     if ($this->regionless !== true && !$this->region) {
         throw new Exceptions\ServiceException(sprintf('The %s service must have a region set. You can either pass in a region string as an argument param, or' . ' set a default region for your user account by executing User::setDefaultRegion and ::update().', $this->name));
     }
     $this->type = $type ?: static::DEFAULT_TYPE;
     $this->urlType = $urlType ?: static::DEFAULT_URL_TYPE;
     $this->setEndpoint($this->findEndpoint());
     $this->client->setBaseUrl($this->getBaseUrl());
     if ($this instanceof EventSubscriberInterface) {
         $this->client->getEventDispatcher()->addSubscriber($this);
     }
 }
开发者ID:gpenverne,项目名称:php-opencloud,代码行数:34,代码来源:CatalogService.php

示例4: setClient

 /**
  * {@inheritDoc}
  */
 public function setClient(ClientInterface $client)
 {
     // The Rackspace Cloud Databases service only supports the
     // RC4 SSL cipher which is not supported by modern OpenSSL clients.
     // Until the service can support additional, more modern and secure
     // ciphers, this SDK has to ask curl to allow using the weaker
     // cipher. For more information, see https://github.com/rackspace/php-opencloud/issues/560
     $curlOptions = $client->getConfig()->get('curl.options');
     $curlOptions['CURLOPT_SSL_CIPHER_LIST'] = static::getSslCipherList();
     $client->getConfig()->set('curl.options', $curlOptions);
     $logMessage = 'The SDK is using a custom cipher suite when connecting ' . 'to the Rackspace Cloud Databases service. This suite contains ' . 'a weak cipher (RC4) so please use at your own risk. See ' . 'https://github.com/rackspace/php-opencloud/issues/560 for details.';
     $client->getLogger()->critical($logMessage);
     $this->client = $client;
 }
开发者ID:kasobus,项目名称:EDENS-Mautic,代码行数:17,代码来源:Service.php


注:本文中的Guzzle\Http\ClientInterface::getLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。