From 50e1cee5c7a8e9354e2bafac22a60b0e369a720f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jan 2018 11:38:26 +0100 Subject: Automatic DI for Controllers also works Signed-off-by: Joas Schilling --- .../updatenotification/lib/AppInfo/Application.php | 48 ++++++---------------- 1 file changed, 12 insertions(+), 36 deletions(-) (limited to 'apps/updatenotification/lib/AppInfo') diff --git a/apps/updatenotification/lib/AppInfo/Application.php b/apps/updatenotification/lib/AppInfo/Application.php index 5eba176f312..49b046c6fef 100644 --- a/apps/updatenotification/lib/AppInfo/Application.php +++ b/apps/updatenotification/lib/AppInfo/Application.php @@ -1,56 +1,32 @@ * - * @author Lukas Reschke - * @author Thomas Müller + * @author Joas Schilling * - * @license AGPL-3.0 + * @license GNU AGPL version 3 or any later version * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . * */ namespace OCA\UpdateNotification\AppInfo; -use OC\AppFramework\Utility\TimeFactory; -use OCA\UpdateNotification\Controller\AdminController; -use OCA\UpdateNotification\UpdateChecker; use OCP\AppFramework\App; -use OCP\AppFramework\IAppContainer; class Application extends App { - public function __construct (array $urlParams = array()) { - parent::__construct('updatenotification', $urlParams); - $container = $this->getContainer(); - - $container->registerService('AdminController', function(IAppContainer $c) { - $updater = new \OC\Updater\VersionCheck( - \OC::$server->getHTTPClientService(), - \OC::$server->getConfig() - ); - return new AdminController( - $c->query('AppName'), - $c->query('Request'), - $c->getServer()->getJobList(), - $c->getServer()->getSecureRandom(), - $c->getServer()->getConfig(), - new TimeFactory(), - $c->getServer()->getL10N($c->query('AppName')), - new UpdateChecker($updater), - $c->getServer()->getDateTimeFormatter() - ); - }); + public function __construct() { + parent::__construct('updatenotification', []); } - } -- cgit v1.2.3