Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-08-15 18:07:55 +0300
committerJoas Schilling <coding@schilljs.com>2016-08-15 18:07:55 +0300
commit06888a89435821f6f64a6dfbc53a622be4c1de50 (patch)
tree7fb574f50ae94440e2d56e0b3613acca8dfa9313 /lib
parent7d35bf707b7db1b9aaea1183c35c80bbcc5328db (diff)
Use automatic DI
Diffstat (limited to 'lib')
-rw-r--r--lib/AppInfo/Application.php31
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index c58207c..cb1e164 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -21,40 +21,13 @@
namespace OCA\Survey_Client\AppInfo;
-use OCA\Survey_Client\Controller\EndpointController;
-use OCA\Survey_Client\Collector;
+
use OCP\AppFramework\App;
-use OCP\IContainer;
class Application extends App {
public function __construct (array $urlParams = array()) {
parent::__construct('survey_client', $urlParams);
- $container = $this->getContainer();
-
- $container->registerService('EndpointController', function(IContainer $c) {
- /** @var \OC\Server $server */
- $server = $c->query('ServerContainer');
-
- return new EndpointController(
- $c->query('AppName'),
- $server->getRequest(),
- $c->query('OCA\Survey_Client\Collector'),
- $server->getJobList(),
- $server->getNotificationManager()
- );
- });
-
- $container->registerService('OCA\Survey_Client\Collector', function(IContainer $c) {
- /** @var \OCP\IServerContainer $server */
- $server = $c->query('ServerContainer');
- return new Collector(
- $server->getHTTPClientService(),
- $server->getConfig(),
- $server->getDatabaseConnection(),
- $server->getIniWrapper(),
- $server->getL10NFactory()->get('survey_client')
- );
- });
+ $this->getContainer()->registerAlias('EndpointController', 'OCA\Survey_Client\Controller\EndpointController');
}
}