Example #1
0
 /**
  * Creates a new, trivial instance of Elgg\Application and set it as the singleton instance.
  * If the singleton is already set, it's returned.
  *
  * @return self
  */
 private static function create()
 {
     if (self::$_instance === null) {
         // we need to register for shutdown before Symfony registers the
         // session_write_close() function. https://github.com/Elgg/Elgg/issues/9243
         register_shutdown_function(function () {
             // There are cases where we may exit before this function is defined
             if (function_exists('_elgg_shutdown_hook')) {
                 _elgg_shutdown_hook();
             }
         });
         self::$_instance = new self(new Di\ServiceProvider(new Config()));
     }
     return self::$_instance;
 }
Example #2
0
 * @subpackage Core
 */
/**
 * The time with microseconds when the Elgg engine was started.
 *
 * @global float
 */
global $START_MICROTIME;
$START_MICROTIME = microtime(true);
// we need to register for shutdown before Symfony registers the session_write_close() function
// https://github.com/Elgg/Elgg/issues/9243
register_shutdown_function(function () {
    // There are cases where we may exit before this function is defined.
    // TODO move this to Application::create in 2.0
    if (function_exists('_elgg_shutdown_hook')) {
        _elgg_shutdown_hook();
    }
});
/**
 * 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
 */