/** * @param \Drufony\Bridge\Event\GetCallableForPhase $event */ public function onBootstrapConfiguration(GetCallableForPhase $event) { // Noop function is important because Pimple will throw an exception // if an undefined service is requested. $event->setCallable(function () { }); }
/** * @param \Drufony\Bridge\Event\GetCallableForPhase $event */ public function onBootstrapEvent(GetCallableForPhase $event) { $bootstrap = $this->bootstrap; $callback = function () use($event, $bootstrap) { $phase = $event->getPhase(); $bootstrap($phase); }; $event->setCallable($callback); }
public function onBootstrapDatabase(GetCallableForPhase $event) { // Page cache is always required. $event->setCallable(function () { // Initialize the database system. Note that the connection // won't be initialized until it is actually requested. require_once DRUPAL_ROOT . '/includes/database/database.inc'; }); }
/** * Event listener replaces the DRUPAL_BOOTSTRAP_PAGE_CACHE to remove * Drupal page caching support. * * @param \Drufony\Bridge\Event\GetCallableForPhase $event * * @see _drupal_bootstrap_page_cache */ public function onBootstrapPageCache(GetCallableForPhase $event) { // Page cache is always required. $event->setCallable(function () { // Allow specifying special cache handlers in settings.php, like // using memcached or files for storing cache information. require_once DRUPAL_ROOT . '/includes/cache.inc'; foreach (variable_get('cache_backends', array()) as $include) { require_once DRUPAL_ROOT . '/' . $include; } }); }
/** * @param \Drufony\Bridge\Event\GetCallableForPhase $event */ public function onBootstrapFull(GetCallableForPhase $event) { $event->setCallable(function () { require_once DRUPAL_ROOT . '/includes/common.inc'; require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc'); require_once DRUPAL_ROOT . '/includes/theme.inc'; require_once DRUPAL_ROOT . '/includes/pager.inc'; require_once DRUPAL_ROOT . '/' . variable_get('menu_inc', 'includes/menu.inc'); require_once DRUPAL_ROOT . '/includes/tablesort.inc'; require_once DRUPAL_ROOT . '/includes/file.inc'; require_once DRUPAL_ROOT . '/includes/unicode.inc'; require_once DRUPAL_ROOT . '/includes/image.inc'; require_once DRUPAL_ROOT . '/includes/form.inc'; require_once DRUPAL_ROOT . '/includes/mail.inc'; require_once DRUPAL_ROOT . '/includes/actions.inc'; require_once DRUPAL_ROOT . '/includes/ajax.inc'; require_once DRUPAL_ROOT . '/includes/token.inc'; require_once DRUPAL_ROOT . '/includes/errors.inc'; // Detect string handling method unicode_check(); // Undo magic quotes fix_gpc_magic(); // Load all enabled modules module_load_all(); // Make sure all stream wrappers are registered. file_get_stream_wrappers(); // Ensure mt_rand is reseeded, to prevent random values from one page load // being exploited to predict random values in subsequent page loads. $seed = unpack("L", drupal_random_bytes(4)); mt_srand($seed[1]); $test_info =& $GLOBALS['drupal_test_info']; if (!empty($test_info['in_child_site'])) { // Running inside the simpletest child site, log fatal errors to test // specific file directory. ini_set('log_errors', 1); ini_set('error_log', 'public://error.log'); } // Initialize $_GET['q'] prior to invoking hook_init(). drupal_path_initialize(); // Remaining function calls from this phase of bootstrap must happen after // the user is authenticated because they initialize the theme and call // menu_get_item(). }); }
/** * Listener prevents output buffering and headers from being sent. * * @param \Drufony\Bridge\Event\GetCallableForPhase $event * * @see _drupal_bootstrap_page_header */ public function onBootstrapPageHeader(GetCallableForPhase $event) { $event->setCallable(function () { bootstrap_invoke_all('boot'); }); }