private function getCache() { if ($this->cacheContent = memcache::getInstance()->get($this->cacheKey)) { if (preg_match_all('/{{{(.*?)}}}/', $this->cacheContent, $this->cachePro)) { return; } //如果没有二级更新则直接输出 echo $this->cacheContent, '<span style="border:1px #ccc dashed;font-size:14px;padding:5px;"><font color="red">Cache Data</font> cacheKey:[' . $this->cacheKey . '] time:', Sys_Microtime() - $GLOBALS['start_time'], '</span>'; exit; } }
function unloadSys() { //关闭Memcache \Sys\memcache::close(); //{{{DeBug echo '<span style="border:1px #ccc dashed;font-size:14px;padding:5px;">cacheKey:[' . @Q('cacheKey') . '] time:'; echo Sys_Microtime() - $GLOBALS['start_time']; echo '</span>'; //}}} }
set_include_path(join(PATH_SEPARATOR, $SysIncludePath)); function __autoload($className) { include strtolower($className) . '.php'; } //载入Dao层 include SYS_LIB . 'core/dbSys.php'; //载入二级缓存类 include SYS_LIB . 'core/cacheProSys.php'; //如果是二级缓存则解析输出 if ($SysCache->cachePro) { $SysCachePro = new \Sys\cachePro($SysCache->cachePro); //二更缓存在些更新输出 DEBUG or exit(strtr($SysCache->cacheContent, $SysCachePro->getConfig())); ///{{{DEBUG echo strtr($SysCache->cacheContent, $SysCachePro->getConfig()), '<span style="border:1px #ccc dashed;font-size:14px;padding:5px;"><font color="red">CachePro Data</font> cacheKey:[' . Q('cacheKey') . '] time:', Sys_Microtime() - $GLOBALS['start_time'], '</span>'; exit; ///}}} } unset($SysCache); //没有缓存和二级缓存 进入下面的控制器构建 $_control = ucfirst(strtolower(Q('control'))) . 'Control'; $_control_file = SYS_APP . 'control/' . $_control . '.php'; $_action = Q('action'); include SYS_LIB . 'smarty/Smarty.class.php'; include SYS_LIB . 'core/viewSys.php'; include SYS_LIB . 'core/controlSys.php'; class_alias('\\Sys\\control', 'control'); //定义模版中用到的变量 define('V_DOMAIN', 'http://' . $_SERVER['SERVER_NAME']); define('V_APP', V_DOMAIN . '/');