+ -
当前位置:首页 → 问答吧 → CakePHP cache helper

CakePHP cache helper

时间:2011-03-19

来源:互联网

转:flyer0126

CakePHP cache helper


Php代码
  1. 1.CakePHP<SPAN>中缓存引擎的分类:   
  2. 2.  
  3. 3.</SPAN>   
  4. 4.  
  5. 5.1. File storage engine     
  6. 6.   文件缓存是cake默认使用的缓存引擎,它将文件写入文件系统,并且包括多个可选参数与预设值。   
  7. 7.2. APC (http://pecl.php.net/package/APC)      
  8. 8.   APC 缓存器 除了添加 XCache 机器码 cache 引擎。   
  9. 9.3. Xcache (http://xcache.lighttpd.net/)   
  10. 10.   PHP opcode 缓存器 除了添加XCache机器码cache引擎,还需要输入用户名、密码来正常工作。   
  11. 11.4. Memcache (http://www.danga.com/memcached/)      
  12. 12.   Memcache一起工作的memcaching服务器允许你创建一个缓存对象在系统内存中。   
  13. CakePHP中缓存引擎的分类:
复制代码
Php代码
  1. 1.1. Cakephp缓存引擎设置: set Configure::Cache.check to true in core   
  2. 2.2. 控制器中引用cache:   
  3. 3.Cacheing in the Controller: var $helpers = array('Cache');   
  4. 4.3. 设置$cacheAction 变量设置   
  5. 5.4. 标示不缓存部分标记:<cake:nocache> … </cake:nocache>   
  6. 6.5. 清除缓存:Cache::clear(). 彻底清理整个缓存。   
  7. 7.6. 一个model的增、删、改操作,对于此model的视图缓存会被清除,下次请求时会产生新的内容。   
  8. 8.//保存或删除后更新相关联的缓存   
  9. 9.function updateCounterCache($keys = array(), $created = false)  
复制代码
Php代码
  1. 1.1.  FileEngine   
  2. 2.require LIBS . 'file.php';  加载libs下的file文件。   
  3. 3.主要函数:   
  4. 4.    function init($settings = array()) 初始化缓存引擎函数;   
  5. 5.    function gc() 垃圾处理函数;   
  6. 6.    function write($key, &$data, $duration) 写缓存函数;   
  7. 7.    function read($key)  读缓存函数;   
  8. 8.    function delete($key) 清除data函数;   
  9. 9.    function clear($check)  清除所有缓存函数;   
  10. 10.    function _setKey($key)  为指定的键取到一个文件;   
  11. 11.function __active()  确定缓存目录可写函数;   
  12. 12.  
  13. 13.2.  ApcEngine   
  14. 14.主要函数:   
  15. 15.    function init($settings = array()) 初始化缓存引擎函数;   
  16. 16.    function write($key, &$data, $duration) 写缓存函数;   
  17. 17.    function read($key)  读缓存函数;   
  18. 18.    function increment($key, $offset = 1) 增加缓存函数;   
  19. 19.    function decrement($key, $offset = 1) 消耗缓存函数;   
  20. 20.    function delete($key) 清除data函数;   
  21. 21.    function clear()  清除所有缓存函数;   
  22. 22.      
  23. 23.3.  XcacheEngine   
  24. 24.主要函数:   
  25. 25.    function init($settings) 初始化缓存引擎函数;   
  26. 26.    function write($key, &$data, $duration) 写缓存函数;   
  27. 27.    function read($key)  读缓存函数;   
  28. 28.    function increment($key, $offset = 1) 增加缓存函数;   
  29. 29.    function decrement($key, $offset = 1) 消耗缓存函数;   
  30. 30.    function delete($key) 清除data函数;   
  31. 31.    function clear()  清除所有缓存函数;   
  32. 32.    function __auth($reverse = false) 权限认证函数;   
  33. 33.4.  MemcacheEngine   
  34. 34.主要函数:   
  35. 35.    function init($settings = array()) 初始化缓存引擎函数;   
  36. 36.    function _parseServerString($server) 解析服务器地址到host/端口。IPv6和IPv4   
  37. 37.    function write($key, &$data, $duration) 写缓存函数;   
  38. 38.    function read($key)  读缓存函数;   
  39. 39.    function increment($key, $offset = 1) 增加缓存函数;   
  40. 40.    function decrement($key, $offset = 1) 消耗缓存函数;   
  41. 41.    function delete($key) 清除data函数;   
  42. 42.    function clear($check)  清除所有缓存函数;   
  43. 43.    function connect($host, $port = 11211) 链接服务器函数;  
复制代码

作者: 听老歌   发布时间: 2011-03-19

没用过cakephp。。。

作者: 紫月亮   发布时间: 2011-03-19

热门下载

更多