从此不求人:自主研发一套PHP前端开发框架(33)之插件化架构实现中
2016-05-28 09:41
519 查看
news.xml
Controller/index.inc
特别注意如果mysql数据库用户权限不够的话那么下面这句sql无法执行
将只会返回一个空的数组
<?xml version="1.0" encoding="utf-8"?> <class> <func> <name>getLogList</name> <sql><![CDATA[ select * from onethink_action ]]> </sql> <description>获取全部的操作日志</description> <resultType>array</resultType> </func> <func> <name>getNewsDetail</name> <sql><![CDATA[ select * from onethink_addons ]]> </sql> <description>获取某条新闻的详细内容</description> <resultType>array</resultType> </func> <func> <name>getNewsSchema</name> <sql><![CDATA[ select * from information_schema.`COLUMNS` WHERE TABLE_SCHEMA='onethink' and TABLE_NAME='onethink_member' and EXTRA!='auto_increment' and COLUMN_COMMENT!='' ]]> </sql> <description>获取新闻表的架构信息,需要相应的账号权限</description> <resultType>int</resultType> </func> </class>
Controller/index.inc
<?php class index extends _Master{ function addnews() { $this->_isadmin=true; $news_schema=$this->news->getNewsSchema(); //特别注意这里我们无法获取到数据是因为没有权限 $this->setVar("tbSet", $news_schema); $this->setView("addnews"); } function admintree() { $tree=array(); $prod_add=array("id"=>2,"text"=>"添加新闻","state"=>"open","attributes"=>array('url'=>"/lkphp/index/addnews/"));//添加新闻 $prod_list=array("id"=>3,"text"=>"新闻列表","state"=>"open"); $prod=array("id"=>1,"text"=>"商品管理","state"=>"open","children"=>array($prod_add,$prod_list)); $tree[]=$prod;//array_push($var) exit(json_encode($tree)); } /** *permission{"role":"admin"} */ function adminindex(){ $this->_isadmin = true; $this->setView('index'); } function showindex(){ $this->setVar('title','测试一下大家的灵活性!'); $this->setView('index'); if(is_login()){ $this->setVar('username',the_user()->user_name); } } } ?>
特别注意如果mysql数据库用户权限不够的话那么下面这句sql无法执行
select * from information_schema.`COLUMNS` WHERE TABLE_SCHEMA='onethink' and TABLE_NAME='onethink_member' and EXTRA!='auto_increment' and COLUMN_COMMENT!=''
将只会返回一个空的数组
相关文章推荐
- 什么是架构
- 什么是架构
- 给外网访问本地网站
- 自助建站工具 搭建出来的网站真的适合SEO吗?
- Android群英传读书笔记第三章(Android控件架构与自定义View)
- [转]Kyoto Cabinet和LevelDB的架构比较分析
- 常用网站
- 小型电子商务网站数据管理系统
- android MVP——mvp架构的应用和优化
- git学习参考网站
- 数据采集测试资料网站
- 网站性能优化
- 游戏服务端架构学习笔记
- 大型网站架构系列:分布式消息队列
- 网站性能优化--Yahoo军规
- 网站收集
- spark应用程序的运行架构(简单到复杂)
- zookeeper + LevelDB + ActiveMQ实现消息队列高可用
- Markdown-入门指南及网站整合
- MVP架构-Android官方MVP项目和响应式MVP-RxJava项目架构分析对比解读