aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/http/client/clientservice.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/http/client/clientservice.php')
-rw-r--r--lib/private/http/client/clientservice.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/private/http/client/clientservice.php b/lib/private/http/client/clientservice.php
new file mode 100644
index 00000000000..795d508e5f9
--- /dev/null
+++ b/lib/private/http/client/clientservice.php
@@ -0,0 +1,43 @@
+<?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());
+ }
+}