summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib/AppInfo
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-01-11 11:38:26 +0100
committerJoas Schilling <coding@schilljs.com>2018-01-15 09:55:03 +0100
commit50e1cee5c7a8e9354e2bafac22a60b0e369a720f (patch)
tree83adf4259ecc27abdf6265dce28d8f057e98eb3f /apps/updatenotification/lib/AppInfo
parentffb3a3e33a2b0468a39ab9f11cf8f63f020bd0bb (diff)
downloadnextcloud-server-50e1cee5c7a8e9354e2bafac22a60b0e369a720f.tar.gz
nextcloud-server-50e1cee5c7a8e9354e2bafac22a60b0e369a720f.zip
Automatic DI for Controllers also works
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification/lib/AppInfo')
-rw-r--r--apps/updatenotification/lib/AppInfo/Application.php48
1 files changed, 12 insertions, 36 deletions
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 @@
<?php
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
+ * @copyright Copyright (c) 2018, Joas Schilling <coding@schilljs.com>
*
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
+ * @author Joas Schilling <coding@schilljs.com>
*
- * @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 <http://www.gnu.org/licenses/>
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
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', []);
}
-
}