Minahito
minah****@users*****
2006年 5月 30日 (火) 12:58:32 JST
Index: xoops2jp/html/modules/legacyRender/class/modulePreloadCacheclear.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/class/modulePreloadCacheclear.class.php:1.1.2.1 --- /dev/null Tue May 30 12:58:32 2006 +++ xoops2jp/html/modules/legacyRender/class/modulePreloadCacheclear.class.php Tue May 30 12:58:32 2006 @@ -0,0 +1,26 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +class legacyRenderModulePreloadCacheclear extends XCube_ActionFilter { + function preBlockFilter() + { + $this->mController->mRoot->mEventManager->add('Module.Legacy.ModuleInstall.Success', new XCube_Delegate("legacyRenderModulePreloadCacheclear", "callback")); + $this->mController->mRoot->mEventManager->add('Module.Legacy.ModuleUpdate.Success', new XCube_Delegate("legacyRenderModulePreloadCacheclear", "callback")); + } + + function callback(&$action, &$module) + { + $handler =& xoops_getmodulehandler('tplfile', 'legacyRender'); + + $criteria =& new Criteria('tpl_module', $module->get('dirname')); + $tplfileArr = $handler->getObjects($criteria); + + $xoopsTpl =& new XoopsTpl(); + foreach (array_keys($tplfileArr) as $key) { + $xoopsTpl->clear_cache('db:' . $tplfileArr[$key]->get('tpl_file')); + $xoopsTpl->clear_compiled_tpl('db:' . $tplfileArr[$key]->get('tpl_file')); + } + } +} +?>