Elgg\Config::__construct PHP Méthode

__construct() public méthode

Constructor
public __construct ( stdClass $config = null, boolean $set_global = true )
$config stdClass Elgg's $CONFIG object
$set_global boolean Copy the config object to global $CONFIG
    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;
        }
    }