public function __construct(\stdClass $config = null, $set_global = true)
{
if (!$config) {
$config = new \stdClass();
}
$this->config = $config;
$this->config->path = Directory\Local::root()->getPath('/');
if ($set_global) {
/**
* Configuration values.
*
* The $CONFIG global contains configuration values required
* for running Elgg as defined in the settings.php file.
*
* Plugin authors are encouraged to use elgg_get_config() instead of accessing
* the global directly.
*
* @see elgg_get_config()
* @see engine/settings.php
* @global \stdClass $CONFIG
*/
global $CONFIG;
$CONFIG = $config;
}
}