From 82d9829c973ee78d0389c3372c93d418afd34c54 Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Sun, 30 Aug 2015 15:00:22 +0100 Subject: [PATCH 1/2] Fire event when BackendService is available --- apps/files_external/appinfo/application.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php index 1e43c73740..aa9e4fd913 100644 --- a/apps/files_external/appinfo/application.php +++ b/apps/files_external/appinfo/application.php @@ -50,6 +50,11 @@ class Application extends App { $this->loadBackends(); $this->loadAuthMechanisms(); + + // app developers: do NOT depend on this! it will disappear with oC 9.0! + \OC::$server->getEventDispatcher()->dispatch( + 'OCA\\Files_External::loadAdditionalBackends' + ); } /** From 3142a20f25343ad3956c204559ec71850242993d Mon Sep 17 00:00:00 2001 From: Robin McCorkell Date: Mon, 31 Aug 2015 15:18:26 +0100 Subject: [PATCH 2/2] Expose files_external services from Server Not exposed to OCP yet --- lib/private/server.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/private/server.php b/lib/private/server.php index a741f33eb3..acafb7b2df 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -1035,4 +1035,36 @@ class Server extends SimpleContainer implements IServerContainer { public function getSessionCryptoWrapper() { return $this->query('CryptoWrapper'); } + + /** + * Not a public API as of 8.2, wait for 9.0 + * @return \OCA\Files_External\Service\BackendService + */ + public function getStoragesBackendService() { + return \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\BackendService'); + } + + /** + * Not a public API as of 8.2, wait for 9.0 + * @return \OCA\Files_External\Service\GlobalStoragesService + */ + public function getGlobalStoragesService() { + return \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\GlobalStoragesService'); + } + + /** + * Not a public API as of 8.2, wait for 9.0 + * @return \OCA\Files_External\Service\UserGlobalStoragesService + */ + public function getUserGlobalStoragesService() { + return \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\UserGlobalStoragesService'); + } + + /** + * Not a public API as of 8.2, wait for 9.0 + * @return \OCA\Files_External\Service\UserStoragesService + */ + public function getUserStoragesService() { + return \OC_Mount_Config::$app->getContainer()->query('OCA\\Files_External\\Service\\UserStoragesService'); + } }