/** * 强制更新缓存 */ public function updateCache() { // self::$__rules = null; // if (isset($this->cache)) { $__rules = $this->readRuleArray(); $this->cache->set('collect.rule', $__rules); } return true; }
public function deleteAction($id, $page = null) { $collect_rule_name = CollectRuleModel::inst()->getRuleNameById($id); $this->db->update('{{collect_rule}}', array('collect_rule_status' => CollectRuleModel::STAT_DELETED), 'collect_rule_id=:collect_rule_id', array(':collect_rule_id' => $id)); CollectRuleModel::inst()->updateCache(); //记录操作日志 $message = '{user_name}删除了采集模板{collect_rule_name}'; $data = array('collect_rule_name' => $collect_rule_name, 'addons_data' => array('collect_rule_id' => $id)); AdminLogs::add('Collect/Rule', $id, 'Delete', 'success', $message, $data); if (!isset($_GET['ajax'])) { $this->redirect('/collect/rule/index'); } }