diff --git a/core/Console.php b/core/Console.php index 086cbaf2c7b846b3bd00f3c38394d90948db47b1..638a810e46f2711b4359a6f71c9f3a35a44bad1d 100644 --- a/core/Console.php +++ b/core/Console.php @@ -61,7 +61,7 @@ class Console */ private function getAvailableCommands() { - $commands = array('Piwik\CliMulti\RequestCommand'); + $commands = $this->getDefaultCommands(); /** * Triggered to gather all available console commands. Plugins that want to expose new console commands @@ -96,7 +96,6 @@ class Console return $config; } catch (\Exception $e) { echo ($e->getMessage() . "\n\n"); - exit(1); } } @@ -106,4 +105,17 @@ class Console $pluginsManager = Plugin\Manager::getInstance(); $pluginsManager->loadPlugins($pluginsToLoad); } + + private function getDefaultCommands() + { + $commands = array( + 'Piwik\CliMulti\RequestCommand' + ); + + if (class_exists('Piwik\Plugins\CloudAdmin\CloudAdmin')) { + $extra = new \Piwik\Plugins\CloudAdmin\CloudAdmin(); + $extra->addConsoleCommands($commands); + } + return $commands; + } }