summaryrefslogtreecommitdiffstats
path: root/apps/files_external/appinfo
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-11-18 15:59:50 +0100
committerRobin Appelman <icewind@owncloud.com>2015-11-23 11:31:40 +0100
commitf5cdd27b22b85e9dfb80bf1b4a29d296f437a3f2 (patch)
tree939f054665cdbef69d30ef90f6518e099213d820 /apps/files_external/appinfo
parentbf672d7e51bd3411130a3c3a41a931fb3d23ff68 (diff)
downloadnextcloud-server-f5cdd27b22b85e9dfb80bf1b4a29d296f437a3f2.tar.gz
nextcloud-server-f5cdd27b22b85e9dfb80bf1b4a29d296f437a3f2.zip
Add files_external:list command to list configured external storages
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r--apps/files_external/appinfo/register_command.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/apps/files_external/appinfo/register_command.php b/apps/files_external/appinfo/register_command.php
new file mode 100644
index 00000000000..a436dc95005
--- /dev/null
+++ b/apps/files_external/appinfo/register_command.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @author Björn Schießle <schiessle@owncloud.com>
+ *
+ * @copyright Copyright (c) 2015, ownCloud, Inc.
+ * @license AGPL-3.0
+ *
+ * This code is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License, version 3,
+ * along with this program. If not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+
+use OCA\Files_External\Command\ListCommand;
+
+$userManager = OC::$server->getUserManager();
+$userSession = OC::$server->getUserSession();
+
+$app = \OC_Mount_Config::$app;
+
+$globalStorageService = $app->getContainer()->query('\OCA\Files_external\Service\GlobalStoragesService');
+$userStorageService = $app->getContainer()->query('\OCA\Files_external\Service\UserStoragesService');
+
+/** @var Symfony\Component\Console\Application $application */
+$application->add(new ListCommand($globalStorageService, $userStorageService, $userSession, $userManager));