message_cate.auto_cache.php 946 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. //底部文章
  3. class message_cate_auto_cache extends auto_cache{
  4. public function load($param)
  5. {
  6. $param=array();
  7. $key = $this->build_key(__CLASS__,$param);
  8. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  9. $message_cate = $GLOBALS['cache']->get($key);
  10. if($message_cate === false)
  11. {
  12. $message_cate = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."message_cate order by id asc");
  13. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  14. $GLOBALS['cache']->set($key,$message_cate);
  15. }
  16. return $message_cate;
  17. }
  18. public function rm($param)
  19. {
  20. $key = $this->build_key(__CLASS__,$param);
  21. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  22. $GLOBALS['cache']->rm($key);
  23. }
  24. public function clear_all()
  25. {
  26. $GLOBALS['cache']->set_dir(APP_ROOT_PATH."public/runtime/data/".__CLASS__."/");
  27. $GLOBALS['cache']->clear();
  28. }
  29. }
  30. ?>