summaryrefslogtreecommitdiffstats
path: root/settings/Application.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-10-27 17:41:15 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-10-31 17:17:44 +0100
commit32cf661215fb3926789054a3953b465fc2665330 (patch)
tree4cf2865bef5856c59a1fdacb98208a14dfc1a128 /settings/Application.php
parent357a823457397d3e93ec8cd4dc01fb6859eb0049 (diff)
downloadnextcloud-server-32cf661215fb3926789054a3953b465fc2665330.tar.gz
nextcloud-server-32cf661215fb3926789054a3953b465fc2665330.zip
Use new appstore API
This change introduces the new appstore API in Nextcloud. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'settings/Application.php')
-rw-r--r--settings/Application.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/settings/Application.php b/settings/Application.php
index dd237e40c9d..3dbf9acc524 100644
--- a/settings/Application.php
+++ b/settings/Application.php
@@ -30,7 +30,11 @@
namespace OC\Settings;
+use OC\App\AppStore\Fetcher\AppFetcher;
+use OC\App\AppStore\Fetcher\CategoryFetcher;
+use OC\AppFramework\Utility\TimeFactory;
use OC\Authentication\Token\IProvider;
+use OC\Server;
use OC\Settings\Middleware\SubadminMiddleware;
use OCP\AppFramework\App;
use OCP\IContainer;
@@ -86,5 +90,24 @@ class Application extends App {
$container->registerService(IManager::class, function (IContainer $c) {
return $c->query('ServerContainer')->getSettingsManager();
});
+ $container->registerService(AppFetcher::class, function (IContainer $c) {
+ /** @var Server $server */
+ $server = $c->query('ServerContainer');
+ return new AppFetcher(
+ $server->getAppDataDir('appstore'),
+ $server->getHTTPClientService(),
+ new TimeFactory(),
+ $server->getConfig()
+ );
+ });
+ $container->registerService(CategoryFetcher::class, function (IContainer $c) {
+ /** @var Server $server */
+ $server = $c->query('ServerContainer');
+ return new CategoryFetcher(
+ $server->getAppDataDir('appstore'),
+ $server->getHTTPClientService(),
+ new TimeFactory()
+ );
+ });
}
}