7
True, but preload class is one of the first to load and does not have access to database when instantiated. This need to be done using a cache file holding the current installed and active modules. That will be done on XOOPS 2.5. For now modules will have to check if they are installed and active in the preload itself before executing any code.
Look on example from profile preload:
function eventCoreUserinfoStart($args)
{
if ( ProfileCorePreload::isActive() ) {
header("location: ./modules/profile/userinfo.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']) );
exit();
}
}
function isActive()
{
$module_handler =& xoops_getHandler('module');
$module = $module_handler->getByDirname('profile');
return ($module && $module->getVar('isactive') ) ? true : false;
}