Skip to content

Commit

Permalink
Added parameter that forbids plugin discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
Markcial committed Mar 3, 2015
1 parent 5971754 commit c9b34d8
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/Psy/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ class Configuration
'defaultIncludes', 'useReadline', 'usePcntl', 'codeCleaner', 'pager',
'loop', 'configDir', 'dataDir', 'runtimeDir', 'manualDbFile',
'requireSemicolons', 'historySize', 'eraseDuplicates', 'tabCompletion',
'tabCompletionMatchers',
'tabCompletionMatchers', 'registerPlugins',
);

private $registerPlugins = true;
private $defaultIncludes;
private $configDir;
private $dataDir;
Expand Down Expand Up @@ -75,9 +76,6 @@ class Configuration
*/
public function __construct(array $config = array())
{
// ask the plugin manager for configurations
$config = Manager::getConfiguration($config);

// explicit configFile option
if (isset($config['configFile'])) {
$this->configFile = $config['configFile'];
Expand All @@ -100,6 +98,27 @@ public function __construct(array $config = array())
// go go gadget, config!
$this->loadConfig($config);
$this->init();

// ask the plugin manager for configurations
if ($this->getRegisterPlugins()) {
$this->loadConfig(Manager::getConfiguration($config));
}
}

/**
* @param $bool
*/
public function setRegisterPlugins($bool)
{
$this->registerPlugins = $bool;
}

/**
* @return bool
*/
public function getRegisterPlugins()
{
return $this->registerPlugins;
}

/**
Expand Down

0 comments on commit c9b34d8

Please sign in to comment.