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 /apps/files_sharing/appinfo | |
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 'apps/files_sharing/appinfo')
-rw-r--r-- | apps/files_sharing/appinfo/application.php | 6 | ||||
-rw-r--r-- | apps/files_sharing/appinfo/routes.php | 11 |
2 files changed, 13 insertions, 4 deletions
diff --git a/apps/files_sharing/appinfo/application.php b/apps/files_sharing/appinfo/application.php index 2fe9019d54e..530195c65fa 100644 --- a/apps/files_sharing/appinfo/application.php +++ b/apps/files_sharing/appinfo/application.php @@ -62,7 +62,8 @@ class Application extends App { $c->query('AppName'), $c->query('Request'), $c->query('IsIncomingShareEnabled'), - $c->query('ExternalManager') + $c->query('ExternalManager'), + $c->query('HttpClientService') ); }); @@ -78,6 +79,9 @@ class Application extends App { $container->registerService('UserManager', function (SimpleContainer $c) use ($server) { return $server->getUserManager(); }); + $container->registerService('HttpClientService', function (SimpleContainer $c) use ($server) { + return $server->getHTTPClientService(); + }); $container->registerService('IsIncomingShareEnabled', function (SimpleContainer $c) { return Helper::isIncomingServer2serverShareEnabled(); }); diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index 1e99267a43a..184ad29bba4 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -33,7 +33,14 @@ $application = new Application(); $application->registerRoutes($this, [ 'resources' => [ 'ExternalShares' => ['url' => '/api/externalShares'], - ] + ], + 'routes' => [ + [ + 'name' => 'externalShares#testRemote', + 'url' => '/testremote', + 'verb' => 'GET' + ], + ], ]); /** @var $this \OCP\Route\IRouter */ @@ -50,8 +57,6 @@ $this->create('sharing_external_shareinfo', '/shareinfo') ->actionInclude('files_sharing/ajax/shareinfo.php'); $this->create('sharing_external_add', '/external') ->actionInclude('files_sharing/ajax/external.php'); -$this->create('sharing_external_test_remote', '/testremote') - ->actionInclude('files_sharing/ajax/testremote.php'); // OCS API |