From 543190f8b3228b994ba897c9a43fdc3f61adf663 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 11 Oct 2019 08:33:09 +0200 Subject: Do not create Application instances directly Signed-off-by: Christoph Wurst --- apps/encryption/appinfo/app.php | 3 ++- apps/encryption/appinfo/routes.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'apps/encryption') diff --git a/apps/encryption/appinfo/app.php b/apps/encryption/appinfo/app.php index a39464e21f8..97d7e8f7488 100644 --- a/apps/encryption/appinfo/app.php +++ b/apps/encryption/appinfo/app.php @@ -28,7 +28,8 @@ namespace OCA\Encryption\AppInfo; $encryptionSystemReady = \OC::$server->getEncryptionManager()->isReady(); -$app = new Application(); +/** @var Application $app */ +$app = \OC::$server->query(Application::class); if ($encryptionSystemReady) { $app->registerEncryptionModule(); $app->registerHooks(); diff --git a/apps/encryption/appinfo/routes.php b/apps/encryption/appinfo/routes.php index 22f3af7fbfb..4c01dd57ad3 100644 --- a/apps/encryption/appinfo/routes.php +++ b/apps/encryption/appinfo/routes.php @@ -24,7 +24,9 @@ namespace OCA\Encryption\AppInfo; -(new Application())->registerRoutes($this, array('routes' => array( +/** @var Application $app */ +$app = \OC::$server->query(Application::class); +$app->registerRoutes($this, array('routes' => array( [ 'name' => 'Recovery#adminRecovery', -- cgit v1.2.3 From 12c13b86d878986e180c4383541a11dbfb90f8b8 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 14 Oct 2019 22:59:16 +0200 Subject: fixup! Do not create Application instances directly Signed-off-by: Roeland Jago Douma --- apps/encryption/appinfo/routes.php | 73 ++++++++++++++++------------------ apps/files_trashbin/appinfo/routes.php | 9 ++--- 2 files changed, 37 insertions(+), 45 deletions(-) (limited to 'apps/encryption') diff --git a/apps/encryption/appinfo/routes.php b/apps/encryption/appinfo/routes.php index 4c01dd57ad3..f7eb7ff5775 100644 --- a/apps/encryption/appinfo/routes.php +++ b/apps/encryption/appinfo/routes.php @@ -1,4 +1,5 @@ query(Application::class); -$app->registerRoutes($this, array('routes' => array( - - [ - 'name' => 'Recovery#adminRecovery', - 'url' => '/ajax/adminRecovery', - 'verb' => 'POST' - ], - [ - 'name' => 'Settings#updatePrivateKeyPassword', - 'url' => '/ajax/updatePrivateKeyPassword', - 'verb' => 'POST' - ], - [ - 'name' => 'Settings#setEncryptHomeStorage', - 'url' => '/ajax/setEncryptHomeStorage', - 'verb' => 'POST' - ], - [ - 'name' => 'Recovery#changeRecoveryPassword', - 'url' => '/ajax/changeRecoveryPassword', - 'verb' => 'POST' - ], - [ - 'name' => 'Recovery#userSetRecovery', - 'url' => '/ajax/userSetRecovery', - 'verb' => 'POST' - ], - [ - 'name' => 'Status#getStatus', - 'url' => '/ajax/getStatus', - 'verb' => 'GET' +return [ + 'routes' => [ + [ + 'name' => 'Recovery#adminRecovery', + 'url' => '/ajax/adminRecovery', + 'verb' => 'POST' + ], + [ + 'name' => 'Settings#updatePrivateKeyPassword', + 'url' => '/ajax/updatePrivateKeyPassword', + 'verb' => 'POST' + ], + [ + 'name' => 'Settings#setEncryptHomeStorage', + 'url' => '/ajax/setEncryptHomeStorage', + 'verb' => 'POST' + ], + [ + 'name' => 'Recovery#changeRecoveryPassword', + 'url' => '/ajax/changeRecoveryPassword', + 'verb' => 'POST' + ], + [ + 'name' => 'Recovery#userSetRecovery', + 'url' => '/ajax/userSetRecovery', + 'verb' => 'POST' + ], + [ + 'name' => 'Status#getStatus', + 'url' => '/ajax/getStatus', + 'verb' => 'GET' + ], ] - - -))); +]; diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php index 8f5530d644c..9f85e27bedc 100644 --- a/apps/files_trashbin/appinfo/routes.php +++ b/apps/files_trashbin/appinfo/routes.php @@ -1,4 +1,5 @@ @@ -22,11 +23,7 @@ * */ -namespace OCA\Files_Trashbin\AppInfo; - -/** @var Application $application */ -$application = \OC::$server->query(Application::class); -$application->registerRoutes($this, [ +return [ 'routes' => [ [ 'name' => 'Preview#getPreview', @@ -34,4 +31,4 @@ $application->registerRoutes($this, [ 'verb' => 'GET', ], ], -]); +]; -- cgit v1.2.3