diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-11-04 18:18:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-04 18:18:32 +0100 |
commit | 13960b69da2593dcfb0cbaef222ee8b9a33142c0 (patch) | |
tree | ca43ed0f4daa75e6b03b137b3ad650c8b721efa7 /apps/encryption | |
parent | 64bfd4bbeb10e07bd2133a97c50175a156d43d61 (diff) | |
parent | 964dc0a95520efbf876e0113bfafc294f4f4b322 (diff) | |
download | nextcloud-server-13960b69da2593dcfb0cbaef222ee8b9a33142c0.tar.gz nextcloud-server-13960b69da2593dcfb0cbaef222ee8b9a33142c0.zip |
Merge pull request #17509 from nextcloud/fix/application-singleton
Fix Application instances created multiple times
Diffstat (limited to 'apps/encryption')
-rw-r--r-- | apps/encryption/appinfo/app.php | 3 | ||||
-rw-r--r-- | apps/encryption/appinfo/routes.php | 71 |
2 files changed, 36 insertions, 38 deletions
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..f7eb7ff5775 100644 --- a/apps/encryption/appinfo/routes.php +++ b/apps/encryption/appinfo/routes.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @@ -21,41 +22,37 @@ * */ - -namespace OCA\Encryption\AppInfo; - -(new Application())->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' + ], ] - - -))); +]; |