Smarty缓存
时间:2007-03-06 来源:lib
流水孟春(121169238(at)qq.com)
原创,转载请注明出处:
http://blog.chinaunix.net/u/27731/showart_253830.html
缓存读取
文件: SMARTY_CORE_DIR . 'core.read_cache_file.php'
函数: smarty_core_read_cache_file($_params, $this)
调用:
Smarty::is_cached()
Smarty::fetch()
缓存写入:
文件: core.write_cache_file.php
函数: smarty_core_write_cache_file($params, &$smarty)
调用: Smarty::fetch();
●在缓存的顶上的一堆乱东西两边分别加上
修改缓存的顶上显示的数据(系列化缓存信息后的字节码),使浏览器不显示,但对程序没有影响.
修改core.write_cache_file.php
第66行: $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results'];
改成: $params['results'] = "" . $params['results'] . "\n";
这样就分别在系列化后的缓存信息两边加上了,就不会显示一些人看来是一堆乱东西的系列化后的缓存信息.
修改 SMARTY_CORE_DIR . 'core.read_cache_file.php';
第53行: $_info_len = (int)substr($_contents, 0, $_info_start - 1);
改成$_info_len = (int)substr($_contents, strlen(""));
这样保证你的程序正确反系列化缓存信息字节流.
相关阅读 更多 +
排行榜 更多 +