/**
* @file
*
- * Perform the first system bootstrap.
+ * Perform the full bootstrap.
+ *
+ * GOAL: All the standard services (database, DAOs, translations, settings, etc) should be loaded.
+ *
+ * MECHANICS: This basically calls `CRM_Core_Config::singleton(TRUE,TRUE)`.
+ *
+ * NOTE: This is technically a *reboot*. `Preboot` started things off, but it
+ * booted with `CRM_Core_Config::singleton($loadFromDB==FALSE)`. Now, the DB is
+ * populated, so we can teardown the preboot stuff and start again with `$loadFromDB==TRUE`.
*/
if (!defined('CIVI_SETUP')) {
->addListener('civi.setup.installDatabase', function (\Civi\Setup\Event\InstallDatabaseEvent $e) {
\Civi\Setup::log()->info(sprintf('[%s] Bootstrap CiviCRM', basename(__FILE__)));
- if (!defined('CIVICRM_SETTINGS_PATH')) {
- define('CIVICRM_SETTINGS_PATH', $e->getModel()->settingsPath);
- }
-
- if (realpath(CIVICRM_SETTINGS_PATH) !== realpath($e->getModel()->settingsPath)) {
- throw new \RuntimeException(sprintf("Cannot boot: The civicrm.settings.php path appears inconsistent (%s vs %s)", CIVICRM_SETTINGS_PATH, $e->getModel()->settingsPath));
- }
-
- include_once CIVICRM_SETTINGS_PATH;
-
- require_once 'CRM/Core/ClassLoader.php';
- CRM_Core_ClassLoader::singleton()->register();
+ \CRM_Core_I18n::$SQL_ESCAPER = NULL;
+ unset(\Civi::$statics['testPreInstall']);
- CRM_Core_Config::singleton(TRUE);
+ CRM_Core_Config::singleton(TRUE, TRUE);
}, \Civi\Setup::PRIORITY_MAIN - 200);