获取数据库菜单利用缓存处理
来源:互联网 发布:生物网络知识构建图 编辑:程序博客网 时间:2024/05/16 19:00
require_once("./include/common.inc.php");
$istrue=$_REQUEST['creatfile'];
$number=$_REQUEST['tag']?'':1;
$ID=$_REQUEST['id'];
$today=date('Y-m-d');
$datetime=$_REQUEST['date']!=''?$_REQUEST['date']:$today;
//获取菜单数据
if($istrue){
$content=getSjcxTree();
$string="<?php /n return ".var_export($content,true)."?>";
$filepath=WEB_ROOT.'/Cache/sjcxmenu.php';
file_put_contents($filepath,$string);
}
$menu=include_once(WEB_ROOT.'/Cache/sjcxmenu.php');//getSjcxTree();
$info=getContentById($ID,$datetime);
$image=getImage($ID);
$i=0;
foreach($menu as $v){
if($menu[$i]['ID']==$ID){
$className=$v['ClassName'];
}
$i++;
}
include_once('sjcx.php');
//本页面使用到的方法
/**
* 获取手机彩信库栏目数据
*/
function getSjcxTree(){
global $db;
$sql="select * from tclasstree where ParentClassID='C4918' order by OrderBy";
$query=$db->query($sql);
while($result = $db->fetch_array($query)) {
$res[]=$result;
}
return $res;
}
运行前需要自己部署
require_once("./include/common.inc.php");
$istrue=$_REQUEST['creatfile'];
$number=$_REQUEST['tag']?'':1;
$ID=$_REQUEST['id'];
$today=date('Y-m-d');
$datetime=$_REQUEST['date']!=''?$_REQUEST['date']:$today;
//获取菜单数据
if($istrue){
$content=getSjcxTree();
$string="<?php /n return ".var_export($content,true)."?>";
$filepath=WEB_ROOT.'/Cache/sjcxmenu.php';
file_put_contents($filepath,$string);
}
$menu=include_once(WEB_ROOT.'/Cache/sjcxmenu.php');//getSjcxTree();
$info=getContentById($ID,$datetime);
$image=getImage($ID);
$i=0;
foreach($menu as $v){
if($menu[$i]['ID']==$ID){
$className=$v['ClassName'];
}
$i++;
}
include_once('sjcx.php');
//本页面使用到的方法
/**
* 获取手机彩信库栏目数据
*/
function getSjcxTree(){
global $db;
$sql="select * from tclasstree where ParentClassID='C4918' order by OrderBy";
$query=$db->query($sql);
while($result = $db->fetch_array($query)) {
$res[]=$result;
}
return $res;
}
运行前需要自己部署
- 获取数据库菜单利用缓存处理
- 利用缓存处理用户注册时的邮箱验证,成功后用户数据存入数据库
- 利用ServletContextLinstener获取并缓存数据源
- 利用ServletContextLinstener获取并缓存数据源
- Magento 利用block缓存 查询的所有分类菜单
- 获取数据库缓存中的执行计划
- 海量数据库(详解缓存处理方法)
- 使用skin++后如何利用GetMenu获取菜单指针
- 96利用反射获取缓存和应用程序的大小信息
- 根据包名利用反射获取缓存信息
- springboot利用缓存存储对象从新获取异常
- Session操作, 查询过滤, 缓存利用, 批量处理
- hibernate的Session操作, 查询过滤, 缓存利用, 批量处理
- Hibernate Session操作, 查询过滤, 缓存利用, 批量处理
- 利用 Spring 和 EHCache 做方法缓存处理
- android中利用LruCache对图片进行缓存处理
- 浅谈thinkPHP中利用缓存处理高并发的思路
- 利用反射获取SQL数据库的对象
- Cookie和会话状态的工作原理及Cookie欺骗
- js对时间进行比较
- 字符编码知识
- 自动化测试框架设计参考准则
- ASP.NET 重要对象 HttpApplication
- 获取数据库菜单利用缓存处理
- PHP重定向
- C++ 仿函数(functor) (转载)
- Android性能测试工具--Oprofile
- Linux设备驱动之I2C架构分析
- Int2hex hex2int
- Android ndk r4b开发环境搭建
- (转)Event Logging 技术简介
- Java技巧:java实现文件监控技巧分享