/** * boot the controller * * @param AbstractBundle $bundle */ public function boot(AbstractBundle $bundle) { // load optional bootstrap $bootstrap = $bundle->getPath() . "/bootstrap.php"; if (file_exists($bootstrap)) { include_once $bootstrap; } // load any plugins // @todo adjust this when Namespaced plugins are implemented \PluginUtil::loadPlugins($bundle->getPath() . "/plugins", "ModulePlugin_{$this->name}"); }
/** * Load system plugins. * * Implements 'core.init' event when Zikula_Core::STAGE_TABLES. * * @param Zikula_Event $event The event handler. * * @return void */ public function systemPlugins(Zikula_Event $event) { if ($event['stage'] & Zikula_Core::STAGE_TABLES) { if (!System::isInstalling()) { ServiceUtil::loadPersistentServices(); PluginUtil::loadPlugins(realpath(realpath('.') . '/plugins'), "SystemPlugin"); EventUtil::loadPersistentEvents(); } } }
/** * Initialize object oriented module. * * @param string $moduleName Module name. * * @return boolean */ public static function initOOModule($moduleName) { if (self::isInitialized($moduleName)) { return true; } $modinfo = self::getInfo(self::getIdFromName($moduleName)); if (!$modinfo) { return false; } $modpath = $modinfo['type'] == self::TYPE_SYSTEM ? 'system' : 'modules'; $osdir = DataUtil::formatForOS($modinfo['directory']); ZLoader::addAutoloader($moduleName, realpath("{$modpath}/{$osdir}/lib")); // load optional bootstrap $bootstrap = "{$modpath}/{$osdir}/bootstrap.php"; if (file_exists($bootstrap)) { include_once $bootstrap; } // register any event handlers. // module handlers must be attached from the bootstrap. if (is_dir("config/EventHandlers/{$osdir}")) { EventUtil::attachCustomHandlers("config/EventHandlers/{$osdir}"); } // load any plugins PluginUtil::loadPlugins("{$modpath}/{$osdir}/plugins", "ModulePlugin_{$osdir}"); self::$ooModules[$moduleName]['initialized'] = true; return true; }