public function loadConfig($config)
{
// Test to see if the config is already set and changes are allowed.
if (null !== $this->config && !$this->config->changesAllowed()) {
throw new Exception('Real-time configuration changes are not allowed.');
}
// Else, set the new config
if (is_array($config)) {
$this->config = new Config($config);
} else {
if ($config instanceof Config) {
$this->config = $config;
} else {
throw new Exception('The project config must be either an array or an instance of Pop\\Config.');
}
}
return $this;
}