Merge pull request #17388 from seamuslee001/domain_tokens_message_template_admin_inte...
[civicrm-core.git] / setup / plugins / installDatabase / BootstrapCivi.civi-setup.php
1 <?php
2 /**
3 * @file
4 *
5 * Perform the full bootstrap.
6 *
7 * GOAL: All the standard services (database, DAOs, translations, settings, etc) should be loaded.
8 *
9 * MECHANICS: This basically calls `CRM_Core_Config::singleton(TRUE,TRUE)`.
10 *
11 * NOTE: This is technically a *reboot*. `Preboot` started things off, but it
12 * booted with `CRM_Core_Config::singleton($loadFromDB==FALSE)`. Now, the DB is
13 * populated, so we can teardown the preboot stuff and start again with `$loadFromDB==TRUE`.
14 */
15
16 if (!defined('CIVI_SETUP')) {
17 exit("Installation plugins must only be loaded by the installer.\n");
18 }
19
20 \Civi\Setup::dispatcher()
21 ->addListener('civi.setup.installDatabase', function (\Civi\Setup\Event\InstallDatabaseEvent $e) {
22 \Civi\Setup::log()->info(sprintf('[%s] Bootstrap CiviCRM', basename(__FILE__)));
23
24 \CRM_Core_I18n::$SQL_ESCAPER = NULL;
25 unset(\Civi::$statics['testPreInstall']);
26
27 CRM_Core_Config::singleton(TRUE, TRUE);
28
29 }, \Civi\Setup::PRIORITY_MAIN - 200);