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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Console.php')
-rw-r--r--core/Console.php17
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;
}
}