44 lines
961 B
PHP
44 lines
961 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com>
|
||
|
* This file is licensed under the Affero General Public License version 3 or
|
||
|
* later.
|
||
|
* See the COPYING-README file.
|
||
|
*/
|
||
|
|
||
|
namespace OC\Http\Client;
|
||
|
|
||
|
use GuzzleHttp\Client as GuzzleClient;
|
||
|
use OCP\Http\Client\IClientService;
|
||
|
use OCP\ICertificateManager;
|
||
|
use OCP\IConfig;
|
||
|
|
||
|
/**
|
||
|
* Class ClientService
|
||
|
*
|
||
|
* @package OC\Http
|
||
|
*/
|
||
|
class ClientService implements IClientService {
|
||
|
/** @var IConfig */
|
||
|
private $config;
|
||
|
/** @var ICertificateManager */
|
||
|
private $certificateManager;
|
||
|
|
||
|
/**
|
||
|
* @param IConfig $config
|
||
|
* @param ICertificateManager $certificateManager
|
||
|
*/
|
||
|
public function __construct(IConfig $config,
|
||
|
ICertificateManager $certificateManager) {
|
||
|
$this->config = $config;
|
||
|
$this->certificateManager = $certificateManager;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return Client
|
||
|
*/
|
||
|
public function newClient() {
|
||
|
return new Client($this->config, $this->certificateManager, new GuzzleClient());
|
||
|
}
|
||
|
}
|