diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-08-22 14:36:01 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-08-22 14:39:43 +0200 |
commit | 0a1d551090696b6423cf4fe0740468bff912a972 (patch) | |
tree | 5efff5151f8bea86ec11d8d5db6d71c40d890cab /lib | |
parent | 510010e774c4019b7fc616c90085649abb7afac3 (diff) | |
download | nextcloud-server-0a1d551090696b6423cf4fe0740468bff912a972.tar.gz nextcloud-server-0a1d551090696b6423cf4fe0740468bff912a972.zip |
Use IClientService to check for remote ownCloud instances
1. Allows to set a timeout (though still not perfect but way better than before)
2. Allows to have unit tests
3. I also added unit tests for the existing controller code
4. Corrected PHPDoc on IClient
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/http/client/client.php | 5 | ||||
-rw-r--r-- | lib/public/http/client/iclient.php | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/http/client/client.php b/lib/private/http/client/client.php index fb3e06f3c46..323fc0d324f 100644 --- a/lib/private/http/client/client.php +++ b/lib/private/http/client/client.php @@ -144,6 +144,7 @@ class Client implements IClient { * 'debug' => true, * 'timeout' => 5, * @return Response + * @throws \Exception If the request could not get completed */ public function head($uri, $options = []) { $response = $this->client->head($uri, $options); @@ -176,6 +177,7 @@ class Client implements IClient { * 'debug' => true, * 'timeout' => 5, * @return Response + * @throws \Exception If the request could not get completed */ public function post($uri, array $options = []) { $response = $this->client->post($uri, $options); @@ -208,6 +210,7 @@ class Client implements IClient { * 'debug' => true, * 'timeout' => 5, * @return Response + * @throws \Exception If the request could not get completed */ public function put($uri, array $options = []) { $response = $this->client->put($uri, $options); @@ -240,6 +243,7 @@ class Client implements IClient { * 'debug' => true, * 'timeout' => 5, * @return Response + * @throws \Exception If the request could not get completed */ public function delete($uri, array $options = []) { $response = $this->client->delete($uri, $options); @@ -273,6 +277,7 @@ class Client implements IClient { * 'debug' => true, * 'timeout' => 5, * @return Response + * @throws \Exception If the request could not get completed */ public function options($uri, array $options = []) { $response = $this->client->options($uri, $options); diff --git a/lib/public/http/client/iclient.php b/lib/public/http/client/iclient.php index aadb9efd1bb..494ca7d419e 100644 --- a/lib/public/http/client/iclient.php +++ b/lib/public/http/client/iclient.php @@ -80,6 +80,7 @@ interface IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * @return IResponse + * @throws \Exception If the request could not get completed * @since 8.1.0 */ public function head($uri, $options = []); @@ -109,6 +110,7 @@ interface IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * @return IResponse + * @throws \Exception If the request could not get completed * @since 8.1.0 */ public function post($uri, array $options = []); @@ -138,6 +140,7 @@ interface IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * @return IResponse + * @throws \Exception If the request could not get completed * @since 8.1.0 */ public function put($uri, array $options = []); @@ -167,6 +170,7 @@ interface IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * @return IResponse + * @throws \Exception If the request could not get completed * @since 8.1.0 */ public function delete($uri, array $options = []); @@ -196,6 +200,7 @@ interface IClient { * 'verify' => true, // bool or string to CA file * 'debug' => true, * @return IResponse + * @throws \Exception If the request could not get completed * @since 8.1.0 */ public function options($uri, array $options = []); |