/** * Initialize class. * Search all events in modules and cache them. * @static */ public static function init() { self::$initialized = true; SystemModules::loadEventsFile(); foreach (SystemModules::getInstalled() as $module) { $className = ucfirst($module->name) . 'ModuleEvents'; if (class_exists($className, false)) { self::loadEventsClass($className); } } }