public function registerSubscribers(InputInterface $in, OutputInterface $out, OAuthProtectedService $service)
 {
     if (TRUE == $in->getOption('debug')) {
         $adapter = new ClosureLogAdapter(function ($message, $priority, $extras) use($out) {
             // @todo handle $priority
             $out->writeln($message);
         });
         $format = "\n\n# Request:\n{request}\n\n# Response:\n{response}\n\n# Errors: {curl_code} {curl_error}\n\n";
         $log = new LogPlugin($adapter, $format);
         $service->getHttpClientFactory()->addSubscriber($log);
     }
 }
示例#2
0
 /**
  * @return Client
  */
 protected function getClient(array $additionalOAuthParameters = array())
 {
     $client = parent::getClient($additionalOAuthParameters);
     $client->setDefaultOption('headers', ['Accept' => 'text/xml']);
     return $client;
 }
示例#3
0
 public function __construct($baseUrl, ConsumerCredentials $consumerCredentials, TokenCredentials $tokenCredentials = NULL, $cdbXmlVersion = '3.2')
 {
     parent::__construct($baseUrl, $consumerCredentials, $tokenCredentials);
     $this->cdbXmlVersion = $cdbXmlVersion;
     $this->cdbXmlNamespaceUri = \CultureFeed_Cdb_Xml::namespaceUriForVersion($this->cdbXmlVersion);
 }
示例#4
0
 /**
  * @param string $baseUrl
  * @param ConsumerCredentials $consumerCredentials
  */
 public function __construct($baseUrl, ConsumerCredentials $consumerCredentials)
 {
     parent::__construct($baseUrl, $consumerCredentials);
 }