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); } }
/** * @return Client */ protected function getClient(array $additionalOAuthParameters = array()) { $client = parent::getClient($additionalOAuthParameters); $client->setDefaultOption('headers', ['Accept' => 'text/xml']); return $client; }
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); }
/** * @param string $baseUrl * @param ConsumerCredentials $consumerCredentials */ public function __construct($baseUrl, ConsumerCredentials $consumerCredentials) { parent::__construct($baseUrl, $consumerCredentials); }