XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
Cacheclear.class.php
1<?php
6
7if (!defined('XOOPS_ROOT_PATH')) {
8 exit();
9}
10
11/***
12 * @internal
13 * @todo
14 * This may have to be admin-preload.
15 */
17{
18 public function preBlockFilter()
19 {
20 $this->mRoot->mDelegateManager->add('Legacy_ModuleInstallAction.InstallSuccess', [$this, 'cacheClear']);
21 $this->mRoot->mDelegateManager->add('Legacy_ModuleUpdateAction.UpdateSuccess', [$this, 'cacheClear']);
22 $this->mRoot->mDelegateManager->add('Legacy_ModuleUninstaller._fireNotifyUninstallTemplateBegun', [$this, 'cacheClear']);
23 }
24
25 public function cacheClear(&$module)
26 {
27 $handler =& xoops_getmodulehandler('tplfile', 'legacyRender');
28
29 $criteria =new Criteria('tpl_module', $module->get('dirname'));
30 $tplfileArr = $handler->getObjects($criteria);
31
32 $xoopsTpl =new XoopsTpl();
33 foreach (array_keys($tplfileArr) as $key) {
34 $xoopsTpl->clear_cache('db:' . $tplfileArr[$key]->get('tpl_file'));
35 $xoopsTpl->clear_compiled_tpl('db:' . $tplfileArr[$key]->get('tpl_file'));
36 }
37 }
38}
preBlockFilter()
[Abstract] Executes the logic, when the controller executes preBlockFilter().