------cache-------------------------- // 从缓存中读取,避免重复从数据库取数据 function data_read_cache($tid) { global $conf; $key = 'website_data_' . $tid; static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,要跨进程,可以再加一层缓存: memcached/xcache/apc/ if (isset($cache[$key])) return $cache[$key]; if ('mysql' == $conf['cache']['type']) { $r = data_read($tid); } else { $r = cache_get($key); if (NULL === $r) { $r = data_read($tid); $r and cache_set($key, $r, 1800); // 30分钟 } } $cache[$key] = $r ? $r : NULL; return $cache[$key]; } ?>
Error: Call to undefined function sess_start() in /www/wwwroot/roclinux.cn/tmp/index.inc.php:20 Stack trace: #0 /www/wwwroot/roclinux.cn/index.php(29): include() #1 {main}