summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-10 09:56:38 +0200
committerJoas Schilling <coding@schilljs.com>2017-05-10 09:56:38 +0200
commit538d32fe8734f563f3116c473f770bd4277c925b (patch)
tree004d99e6d04fdf07863ce3983869805b76833b3a /lib
parentca399406146d74f2f46f8b8815f0b3c165c996ab (diff)
downloadnextcloud-server-538d32fe8734f563f3116c473f770bd4277c925b.tar.gz
nextcloud-server-538d32fe8734f563f3116c473f770bd4277c925b.zip
Automatic injection into the Fetchers
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/AppStore/Fetcher/AppFetcher.php8
-rw-r--r--lib/private/App/AppStore/Fetcher/CategoryFetcher.php8
-rw-r--r--lib/private/App/AppStore/Fetcher/Fetcher.php7
-rw-r--r--lib/private/Server.php20
-rw-r--r--lib/private/Updater.php1
5 files changed, 14 insertions, 30 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php
index e020390988e..2e181d754f1 100644
--- a/lib/private/App/AppStore/Fetcher/AppFetcher.php
+++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php
@@ -22,24 +22,24 @@
namespace OC\App\AppStore\Fetcher;
use OC\App\AppStore\Version\VersionParser;
+use OC\Files\AppData\Factory;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\Files\IAppData;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
class AppFetcher extends Fetcher {
/**
- * @param IAppData $appData
+ * @param Factory $appDataFactory
* @param IClientService $clientService
* @param ITimeFactory $timeFactory
* @param IConfig $config;
*/
- public function __construct(IAppData $appData,
+ public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config) {
parent::__construct(
- $appData,
+ $appDataFactory,
$clientService,
$timeFactory,
$config
diff --git a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
index 8b79259a66a..4c786652833 100644
--- a/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
+++ b/lib/private/App/AppStore/Fetcher/CategoryFetcher.php
@@ -21,24 +21,24 @@
namespace OC\App\AppStore\Fetcher;
+use OC\Files\AppData\Factory;
use OCP\AppFramework\Utility\ITimeFactory;
-use OCP\Files\IAppData;
use OCP\Http\Client\IClientService;
use OCP\IConfig;
class CategoryFetcher extends Fetcher {
/**
- * @param IAppData $appData
+ * @param Factory $appDataFactory
* @param IClientService $clientService
* @param ITimeFactory $timeFactory
* @param IConfig $config
*/
- public function __construct(IAppData $appData,
+ public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config) {
parent::__construct(
- $appData,
+ $appDataFactory,
$clientService,
$timeFactory,
$config
diff --git a/lib/private/App/AppStore/Fetcher/Fetcher.php b/lib/private/App/AppStore/Fetcher/Fetcher.php
index 5354d334eb1..ccf5162ed82 100644
--- a/lib/private/App/AppStore/Fetcher/Fetcher.php
+++ b/lib/private/App/AppStore/Fetcher/Fetcher.php
@@ -21,6 +21,7 @@
namespace OC\App\AppStore\Fetcher;
+use OC\Files\AppData\Factory;
use OCP\AppFramework\Http;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\Files\IAppData;
@@ -47,16 +48,16 @@ abstract class Fetcher {
protected $version;
/**
- * @param IAppData $appData
+ * @param Factory $appDataFactory
* @param IClientService $clientService
* @param ITimeFactory $timeFactory
* @param IConfig $config
*/
- public function __construct(IAppData $appData,
+ public function __construct(Factory $appDataFactory,
IClientService $clientService,
ITimeFactory $timeFactory,
IConfig $config) {
- $this->appData = $appData;
+ $this->appData = $appDataFactory->get('appstore');
$this->clientService = $clientService;
$this->timeFactory = $timeFactory;
$this->config = $config;
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 07e449ee4a9..8e17ae397b7 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -420,24 +420,8 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService('AppHelper', function ($c) {
return new \OC\AppHelper();
});
- $this->registerService(AppFetcher::class, function ($c) {
- return new AppFetcher(
- $this->getAppDataDir('appstore'),
- $this->getHTTPClientService(),
- $this->query(TimeFactory::class),
- $this->getConfig()
- );
- });
$this->registerAlias('AppFetcher', AppFetcher::class);
-
- $this->registerService('CategoryFetcher', function ($c) {
- return new CategoryFetcher(
- $this->getAppDataDir('appstore'),
- $this->getHTTPClientService(),
- $this->query(TimeFactory::class),
- $this->getConfig()
- );
- });
+ $this->registerAlias('CategoryFetcher', CategoryFetcher::class);
$this->registerService(\OCP\ICache::class, function ($c) {
return new Cache\File();
@@ -1290,7 +1274,7 @@ class Server extends ServerContainer implements IServerContainer {
* @return AppFetcher
*/
public function getAppFetcher() {
- return $this->query('AppFetcher');
+ return $this->query(AppFetcher::class);
}
/**
diff --git a/lib/private/Updater.php b/lib/private/Updater.php
index 5c4a7725a1b..023b3e6972c 100644
--- a/lib/private/Updater.php
+++ b/lib/private/Updater.php
@@ -32,7 +32,6 @@
namespace OC;
-use OC\App\AppStore\Fetcher\AppFetcher;
use OC\Hooks\BasicEmitter;
use OC\IntegrityCheck\Checker;
use OC_App;