diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2017-01-30 11:49:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-30 11:49:22 +0300 |
commit | a509c890ae192d3b71dcfb4d778f083705740c86 (patch) | |
tree | 17a52fdafe519493f113a49095b6694c8cd38cae /core/Console.php | |
parent | a3b01e53c709b333e8fef2268fe0bfd554da053f (diff) | |
parent | 2667ec85d9a7b4cbd191eb1b2c2369268b105954 (diff) |
Merge pull request #11298 from piwik/3.x-dev3.0.2-b3
Release 3.0.2-b3
Diffstat (limited to 'core/Console.php')
-rw-r--r-- | core/Console.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/Console.php b/core/Console.php index e326211ef8..7a7629443f 100644 --- a/core/Console.php +++ b/core/Console.php @@ -209,6 +209,23 @@ class Console extends Application $commands = array( 'Piwik\CliMulti\RequestCommand' ); + + $commandsFromPluginsMarkedInConfig = $this->getCommandsFromPluginsMarkedInConfig(); + $commands = array_merge($commands, $commandsFromPluginsMarkedInConfig); + + return $commands; + } + + private function getCommandsFromPluginsMarkedInConfig() + { + $plugins = Config::getInstance()->General['always_load_commands_from_plugin']; + $plugins = explode(',', $plugins); + + $commands = array(); + foreach($plugins as $plugin) { + $instance = new Plugin($plugin); + $commands = array_merge($commands, $instance->findMultipleComponents('Commands', 'Piwik\\Plugin\\ConsoleCommand')); + } return $commands; } } |