diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-12 21:43:29 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-19 10:08:23 +0100 |
commit | c592e24c871f0f6a8d688c5c93e769b1505e4b6d (patch) | |
tree | 0b967704610d193c1296ae623ab2b7212e87e2d0 /apps/files_external/appinfo | |
parent | 97dbc79c16ba9d4d6c361d6f397908ef7893954d (diff) | |
download | nextcloud-server-c592e24c871f0f6a8d688c5c93e769b1505e4b6d.tar.gz nextcloud-server-c592e24c871f0f6a8d688c5c93e769b1505e4b6d.zip |
Make Application a singleton
The same Application must be used in the settings templates and in
routes, so that any registered backends are correctly seen
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r-- | apps/files_external/appinfo/app.php | 8 | ||||
-rw-r--r-- | apps/files_external/appinfo/routes.php | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 37a489535ea..6c659af8aac 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -47,8 +47,9 @@ OC::$CLASSPATH['OCA\Files\External\Api'] = 'files_external/lib/api.php'; require_once __DIR__ . '/../3rdparty/autoload.php'; -$app = new \OCA\Files_external\Appinfo\Application(); -$appContainer = $app->getContainer(); +// register Application object singleton +\OC_Mount_Config::$app = new \OCA\Files_external\Appinfo\Application(); +$appContainer = \OC_Mount_Config::$app->getContainer(); $l = \OC::$server->getL10N('files_external'); @@ -65,9 +66,6 @@ if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == ' "name" => $l->t('External storage') ]); -// Teach OC_Mount_Config about the AppFramework -\OC_Mount_Config::initApp($appContainer); - // connecting hooks OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC_Mount_Config', 'initMountPointsHook'); OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\SMB_OC', 'login'); diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php index bc4b0e98c91..213e7b28dc1 100644 --- a/apps/files_external/appinfo/routes.php +++ b/apps/files_external/appinfo/routes.php @@ -28,8 +28,7 @@ namespace OCA\Files_External\AppInfo; /** * @var $this \OC\Route\Router **/ -$application = new Application(); -$application->registerRoutes( +\OC_Mount_Config::$app->registerRoutes( $this, array( 'resources' => array( |