summaryrefslogtreecommitdiffstats
path: root/apps/files_external/appinfo/app.php
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-08-11 18:45:07 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-08-19 10:05:11 +0100
commit37beb58c6f395523d8e2934870c5f52a8c6f6df0 (patch)
treeb14325a790ddaf7236c3f8c1939ce9ef10df58bb /apps/files_external/appinfo/app.php
parent74237a9c44192fb98944ea7f3c14fa6f22c0814b (diff)
downloadnextcloud-server-37beb58c6f395523d8e2934870c5f52a8c6f6df0.tar.gz
nextcloud-server-37beb58c6f395523d8e2934870c5f52a8c6f6df0.zip
Introduce BackendService for managing external storage backends
Backends are registered to the BackendService through new data structures: Backends are concrete classes, deriving from \OCA\Files_External\Lib\Backend\Backend. During construction, the various configuration parameters of the Backend can be set, in a design similar to Symfony Console. DefinitionParameter stores a parameter configuration for an external storage: name of parameter, human-readable name, type of parameter (text, password, hidden, checkbox), flags (optional or not). Storages in the StoragesController now get their parameters validated server-side (fixes a TODO).
Diffstat (limited to 'apps/files_external/appinfo/app.php')
-rw-r--r--apps/files_external/appinfo/app.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 66897eba3d3..37a489535ea 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -30,9 +30,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-$app = new \OCA\Files_external\Appinfo\Application();
-
-$l = \OC::$server->getL10N('files_external');
OC::$CLASSPATH['OC\Files\Storage\StreamWrapper'] = 'files_external/lib/streamwrapper.php';
OC::$CLASSPATH['OC\Files\Storage\FTP'] = 'files_external/lib/ftp.php';
@@ -50,6 +47,11 @@ 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();
+
+$l = \OC::$server->getL10N('files_external');
+
OCP\App::registerAdmin('files_external', 'settings');
if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == 'yes') {
OCP\App::registerPersonal('files_external', 'personal');
@@ -63,6 +65,9 @@ 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');
@@ -237,5 +242,5 @@ OC_Mount_Config::registerBackend('\OC\Files\Storage\SFTP_Key', [
'custom' => 'sftp_key',
]
);
-$mountProvider = new \OCA\Files_External\Config\ConfigAdapter();
+$mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter');
\OC::$server->getMountProviderCollection()->registerProvider($mountProvider);