5 * Perform the first system bootstrap.
8 if (!defined('CIVI_SETUP')) {
9 exit("Installation plugins must only be loaded by the installer.\n");
12 \Civi\Setup
::dispatcher()
13 ->addListener('civi.setup.installDatabase', function (\Civi\Setup\Event\InstallDatabaseEvent
$e) {
14 \Civi\Setup
::log()->info(sprintf('[%s] Bootstrap CiviCRM', basename(__FILE__
)));
16 if (!defined('CIVICRM_SETTINGS_PATH')) {
17 define('CIVICRM_SETTINGS_PATH', $e->getModel()->settingsPath
);
20 if (realpath(CIVICRM_SETTINGS_PATH
) !== realpath($e->getModel()->settingsPath
)) {
21 throw new \
RuntimeException(sprintf("Cannot boot: The civicrm.settings.php path appears inconsistent (%s vs %s)", CIVICRM_SETTINGS_PATH
, $e->getModel()->settingsPath
));
24 include_once CIVICRM_SETTINGS_PATH
;
26 require_once 'CRM/Core/ClassLoader.php';
27 CRM_Core_ClassLoader
::singleton()->register();
29 CRM_Core_Config
::singleton(TRUE);
31 }, \Civi\Setup
::PRIORITY_MAIN
- 200);