}
// OK, this looks new.
- Civi::dispatcher()->dispatch(\Civi\Core\Event\SystemInstallEvent::EVENT_NAME, new \Civi\Core\Event\SystemInstallEvent());
+ Civi::dispatcher()->dispatch('civi.core.install', new \Civi\Core\Event\SystemInstallEvent());
Civi::settings()->set('installed', 1);
}
<?php
namespace Civi\Core;
-use Civi\Core\Event\SystemInstallEvent;
use Civi\Core\Lock\LockManager;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\DependencyInjection\ContainerBuilder;
$dispatcher->setDispatchPolicy(\CRM_Upgrade_DispatchPolicy::get('upgrade.main'));
}
- $dispatcher->addListener(SystemInstallEvent::EVENT_NAME, ['\Civi\Core\InstallationCanary', 'check']);
- $dispatcher->addListener(SystemInstallEvent::EVENT_NAME, ['\Civi\Core\DatabaseInitializer', 'initialize']);
- $dispatcher->addListener(SystemInstallEvent::EVENT_NAME, ['\Civi\Core\LocalizationInitializer', 'initialize']);
+ $dispatcher->addListener('civi.core.install', ['\Civi\Core\InstallationCanary', 'check']);
+ $dispatcher->addListener('civi.core.install', ['\Civi\Core\DatabaseInitializer', 'initialize']);
+ $dispatcher->addListener('civi.core.install', ['\Civi\Core\LocalizationInitializer', 'initialize']);
$dispatcher->addListener('hook_civicrm_post', ['\CRM_Core_Transaction', 'addPostCommit'], -1000);
$dispatcher->addListener('hook_civicrm_pre', ['\Civi\Core\Event\PreEvent', 'dispatchSubevent'], 100);
$dispatcher->addListener('civi.dao.preDelete', ['\CRM_Core_BAO_EntityTag', 'preDeleteOtherEntity']);
/**
* The SystemInstallEvent fires once after installation - during the first page-view.
+ *
+ * @deprecated - You may simply use the event name directly. dev/core#1744
*/
const EVENT_NAME = 'civi.core.install';
* @see \CRM_Utils_Hook::eventDefs
*/
public static function hookEventDefs($e) {
- $e->inspector->addEventClass(self::EVENT_NAME, __CLASS__);
+ $e->inspector->addEventClass('civi.core.install', __CLASS__);
}
}