Skip to content

Commit

Permalink
Revert to loading plugin config files from the INI plugins list
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Feb 5, 2015
1 parent c2a676f commit 984e5e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
10 changes: 6 additions & 4 deletions core/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,22 @@ public function __construct()
);

$this->getDefinition()->addOption($option);

StaticContainer::setEnvironment('cli');
}

public function doRun(InputInterface $input, OutputInterface $output)
{
$this->initPiwikHost($input);
$this->initConfig($output);
$this->initLoggerOutput($output);

try {
self::initPlugins();
} catch(\Exception $e) {
// Piwik not installed yet, no config file?
}

$this->initPiwikHost($input);
$this->initConfig($output);
$this->initLoggerOutput($output);

$commands = $this->getAvailableCommands();

foreach ($commands as $command) {
Expand Down
2 changes: 1 addition & 1 deletion core/Container/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function addEnvironmentConfig(ContainerBuilder $builder)

private function addPluginConfigs(ContainerBuilder $builder)
{
$plugins = Manager::getInstance()->getActivatedPlugins();
$plugins = Config::getInstance()->Plugins['Plugins'];

foreach ($plugins as $plugin) {
$file = Manager::getPluginsDirectory() . $plugin . '/config/config.php';
Expand Down
4 changes: 1 addition & 3 deletions core/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ public function init()

$exceptionToThrow = self::createConfigObject();

// Load plugins before creating the container
Plugin\Manager::getInstance()->loadActivatedPlugins();

$tmpPath = StaticContainer::get('path.tmp');

$directoriesToCheck = array(
Expand All @@ -335,6 +332,7 @@ public function init()
$this->handleSSLRedirection();

Plugin\Manager::getInstance()->loadPluginTranslations();
Plugin\Manager::getInstance()->loadActivatedPlugins();

if ($exceptionToThrow) {
throw $exceptionToThrow;
Expand Down
3 changes: 0 additions & 3 deletions misc/cron/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@
$console->run();
} else { // if running via web request, use CronArchive directly

// Load plugins before the container is created
Piwik\Plugin\Manager::getInstance()->loadActivatedPlugins();

if (Piwik\Common::isPhpCliMode()) {
// We can run the archive in CLI with `php-cgi` so we have to configure the container/logger
// just like for CLI
Expand Down
3 changes: 0 additions & 3 deletions misc/others/cli-script-bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
$GLOBALS['PIWIK_TRACKER_DEBUG'] = false;
define('PIWIK_ENABLE_DISPATCH', false);

// Load plugins before the container is created
Piwik\Plugin\Manager::getInstance()->loadActivatedPlugins();

if (Piwik\Common::isPhpCliMode()) {
StaticContainer::setEnvironment('cli');
/** @var ConsoleHandler $consoleLogHandler */
Expand Down

0 comments on commit 984e5e1

Please sign in to comment.