diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-05-10 17:31:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-10 17:31:05 -0500 |
commit | 167013dbf9e7de63e702854a9e770f73fca016f5 (patch) | |
tree | a740faf531c6eb31daeaf221657c4d9aeb67e919 /core | |
parent | 1c2ccd220611a3c269c8122dcab8a3a6251053ef (diff) | |
parent | 538d32fe8734f563f3116c473f770bd4277c925b (diff) | |
download | nextcloud-server-167013dbf9e7de63e702854a9e770f73fca016f5.tar.gz nextcloud-server-167013dbf9e7de63e702854a9e770f73fca016f5.zip |
Merge pull request #4783 from nextcloud/lite-application-classes
Use automatic injection for appdata folders
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 27 | ||||
-rw-r--r-- | core/Controller/CssController.php | 7 | ||||
-rw-r--r-- | core/Controller/JsController.php | 7 |
3 files changed, 8 insertions, 33 deletions
diff --git a/core/Application.php b/core/Application.php index 6fa301e5906..5fafb0441f0 100644 --- a/core/Application.php +++ b/core/Application.php @@ -30,12 +30,7 @@ namespace OC\Core; -use OC\Core\Controller\JsController; -use OC\Security\IdentityProof\Manager; use OCP\AppFramework\App; -use OC\Core\Controller\CssController; -use OCP\AppFramework\Utility\ITimeFactory; -use OCP\IRequest; use OCP\Util; /** @@ -53,27 +48,5 @@ class Application extends App { $container->registerService('defaultMailAddress', function () { return Util::getDefaultEmailAddress('lostpassword-noreply'); }); - $container->registerService(Manager::class, function () { - return new Manager( - \OC::$server->getAppDataDir('identityproof'), - \OC::$server->getCrypto() - ); - }); - $container->registerService(CssController::class, function () use ($container) { - return new CssController( - $container->query('appName'), - $container->query(IRequest::class), - \OC::$server->getAppDataDir('css'), - $container->query(ITimeFactory::class) - ); - }); - $container->registerService(JsController::class, function () use ($container) { - return new JsController( - $container->query('AppName'), - $container->query(IRequest::class), - $container->getServer()->getAppDataDir('js'), - $container->query(ITimeFactory::class) - ); - }); } } diff --git a/core/Controller/CssController.php b/core/Controller/CssController.php index 57197e9999e..3cf477290fe 100644 --- a/core/Controller/CssController.php +++ b/core/Controller/CssController.php @@ -21,6 +21,7 @@ namespace OC\Core\Controller; +use OC\Files\AppData\Factory; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\NotFoundResponse; @@ -43,13 +44,13 @@ class CssController extends Controller { /** * @param string $appName * @param IRequest $request - * @param IAppData $appData + * @param Factory $appDataFactory * @param ITimeFactory $timeFactory */ - public function __construct($appName, IRequest $request, IAppData $appData, ITimeFactory $timeFactory) { + public function __construct($appName, IRequest $request, Factory $appDataFactory, ITimeFactory $timeFactory) { parent::__construct($appName, $request); - $this->appData = $appData; + $this->appData = $appDataFactory->get('css'); $this->timeFactory = $timeFactory; } diff --git a/core/Controller/JsController.php b/core/Controller/JsController.php index c7c9dea9101..1a025edbcad 100644 --- a/core/Controller/JsController.php +++ b/core/Controller/JsController.php @@ -22,6 +22,7 @@ */ namespace OC\Core\Controller; +use OC\Files\AppData\Factory; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\NotFoundResponse; @@ -44,13 +45,13 @@ class JsController extends Controller { /** * @param string $appName * @param IRequest $request - * @param IAppData $appData + * @param Factory $appDataFactory * @param ITimeFactory $timeFactory */ - public function __construct($appName, IRequest $request, IAppData $appData, ITimeFactory $timeFactory) { + public function __construct($appName, IRequest $request, Factory $appDataFactory, ITimeFactory $timeFactory) { parent::__construct($appName, $request); - $this->appData = $appData; + $this->appData = $appDataFactory->get('js'); $this->timeFactory = $timeFactory; } |