From 0e7589210b483a5a9ff0fdc9836da6d7e6bd7705 Mon Sep 17 00:00:00 2001 From: Marc Garcia Date: Tue, 3 Mar 2015 13:44:04 +0100 Subject: [PATCH] Added parameter that forbids plugin discovery --- src/Psy/Configuration.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Psy/Configuration.php b/src/Psy/Configuration.php index 0d4cbe71c..6981c5013 100644 --- a/src/Psy/Configuration.php +++ b/src/Psy/Configuration.php @@ -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; @@ -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']; @@ -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; } /**