Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-09-13 20:10:04 +0400
committerBart Visscher <bartv@thisnet.nl>2013-09-13 20:10:04 +0400
commit666bbbe06085451c12e4e55b886703e823eabf07 (patch)
treee1bc5bf9cca682c58537270c0ae2b3971be893d7
parent44b3e71ed4e1beb3e815def7ac9bd9848039fb84 (diff)
Use appinfo/register_command.php to add commands to the console command
-rw-r--r--apps/files/appinfo/register_command.php9
-rw-r--r--console.php9
-rw-r--r--core/register_command.php9
3 files changed, 25 insertions, 2 deletions
diff --git a/apps/files/appinfo/register_command.php b/apps/files/appinfo/register_command.php
new file mode 100644
index 00000000000..435ce0ab23f
--- /dev/null
+++ b/apps/files/appinfo/register_command.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$application->add(new OCA\Files\Command\Scan(OC_User::getManager()));
diff --git a/console.php b/console.php
index 2f773cc6a1a..30f4b729214 100644
--- a/console.php
+++ b/console.php
@@ -25,6 +25,11 @@ if (!OC::$CLI) {
$defaults = new OC_Defaults;
$application = new Application($defaults->getName(), \OC_Util::getVersionString());
-$application->add(new OC\Core\Command\Status);
-$application->add(new OCA\Files\Command\Scan(OC_User::getManager()));
+require_once 'core/register_command.php';
+foreach(OC_App::getEnabledApps() as $app) {
+ $file = OC_App::getAppPath($app).'/appinfo/register_command.php';
+ if(file_exists($file)) {
+ require $file;
+ }
+}
$application->run();
diff --git a/core/register_command.php b/core/register_command.php
new file mode 100644
index 00000000000..1eed347b7b5
--- /dev/null
+++ b/core/register_command.php
@@ -0,0 +1,9 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$application->add(new OC\Core\Command\Status);