diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-10-24 14:13:45 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-10-24 14:13:45 +0200 |
commit | dd192e5df94f92bb756b8712c9ec1a57755b7c1b (patch) | |
tree | e99640ec452e6a2ec3d872f954287d9d13901510 /core/Command/Maintenance | |
parent | 3eaf23f29f67dbb6077121cc24beaddd8d587504 (diff) | |
download | nextcloud-server-dd192e5df94f92bb756b8712c9ec1a57755b7c1b.tar.gz nextcloud-server-dd192e5df94f92bb756b8712c9ec1a57755b7c1b.zip |
Use proper DI for repair command
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/Command/Maintenance')
-rw-r--r-- | core/Command/Maintenance/Repair.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/Command/Maintenance/Repair.php b/core/Command/Maintenance/Repair.php index 0d95b0ea3e2..9401dafd26b 100644 --- a/core/Command/Maintenance/Repair.php +++ b/core/Command/Maintenance/Repair.php @@ -27,6 +27,7 @@ namespace OC\Core\Command\Maintenance; use Exception; +use OCP\App\IAppManager; use OCP\IConfig; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; @@ -47,15 +48,20 @@ class Repair extends Command { private $progress; /** @var OutputInterface */ private $output; + /** @var IAppManager */ + private $appManager; /** * @param \OC\Repair $repair * @param IConfig $config + * @param EventDispatcherInterface $dispatcher + * @param IAppManager $appManager */ - public function __construct(\OC\Repair $repair, IConfig $config, EventDispatcherInterface $dispatcher) { + public function __construct(\OC\Repair $repair, IConfig $config, EventDispatcherInterface $dispatcher, IAppManager $appManager) { $this->repair = $repair; $this->config = $config; $this->dispatcher = $dispatcher; + $this->appManager = $appManager; parent::__construct(); } @@ -78,8 +84,7 @@ class Repair extends Command { } } - $appManager = \OC::$server->getAppManager(); - $apps = $appManager->getInstalledApps(); + $apps = $this->appManager->getInstalledApps(); foreach ($apps as $app) { if (!$appManager->isEnabledForUser($app)) { continue; |