php类


Posted in PHP onNovember 27, 2006

<?php
/*----------------------------------------------------------------//
 * Class::    Ini
 * Function:: to install the system which is requested from client     
 * Author::   Kevin#    
 * QQ::       84529890
 * Date::     2006.10.24
//----------------------------------------------------------------*/
 require_once( CLASS_SYS_PATH . "class.db.php");
 class Ini {
 /*
 * member variable $defaultPlay
 * to set the variable play 
 */
 var $defaultPlay = "main";
 /*
 * member variable $DB
 * to set the object : database
 */
 var $DB;
 /*
 * member variable $play
 * record the parameter of play
 */
 var $play;
//////@@@@ MEMBER FUNCTION LIST @@@@\\\\\\\
//-======================================-\\
//      LastModifyTime::2006.11.16 
//-======================================-\\
////////////////////////////////////////////
 /*
 * function :: setDB($db)
 * set the global database object
 */
 function setDB($db){
     return $this->DB = $db;
 }
 /*
 * function::loadSystem($play)
 * load system
 */
 function loadSystem($play){
     if( $this->isValidPlay($play) ){
      require_once("class.smarttemplate.php"); 
  require_once( $play ); 
  $playLikeABird = new Main;
 }else{
     $this->halt("Invalid Access....");
 }
 }
 /*
 * function:: iniCon()
 * install database
 */
 function iniCon(){
     global $DB;
 $DB = new DB( HOST_ADDR , HOST_USER , HOST_PSW , DB_NAME );
 }
 /*
 * function::getDB()
 * to get the current database object
 */
 function getDB(){
     return $this->DB;
 }
 /*
 * function::getPlay()
 * get the play which is post from client
 */
 function getPlay(){
     return $play = empty( $_REQUEST["play"] ) ? $this->defaultPlay : $_REQUEST["play"];
 }
 /*
 * function:: isValidPlay($play)
 * to check legitimacy if the play parameter is 
 */
 function isValidPlay($play){  
 if( file_exists( $play  ) ){
     return true;
 }else{
 return false;
}
 }
 /*
 * function:: halt($msg)
 * show message on the browser 
 */
 function halt($msg){
     echo "<font color=\"#FF0000\">" . $msg . "</font>\n<br />";
 }
 /*
 * function :: iniSystem()
 * install system
 */
 function iniSystem(){
     $this->iniCon();
 $this->setDB($DB);
 $play = $this->getPlay();
 return $play = $this->resetPlay($play);
 }
 /*
 * function :: resetPlay($p)
 * to re-define the play's parameter
 */
 function resetPlay($p){
     return $p = CLASS_PATH . ENTRY_FIRST_FORMAT . $p . ENTRY_LAST_FORMAT;
 } 
 /*
 * function:: Ini()
 * to link the database and get the play which post from client
 */
 function Ini(){
     $play = $this->iniSystem();
 $this->Debug($play);
 $this->loadSystem($play);
 $this->close();
 }
 /*
 * function:: debug($play)
 * to show the debug information
 */
 function debug($play){
     if( DEBUG ) $this->halt("Play -> $play");
 }
 /*
 * function::close()
 * unset database
 */
 function close(){
     return $this->DB = NULL;
 }
 ///////@@@@@@@@@@@@@@@@@@@@@@@@@  define class over @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
 }
?>

PHP 相关文章推荐
MVC模式的PHP实现
Oct 09 PHP
PHP 编程请选择正确的文本编辑软件
Dec 21 PHP
PHP substr 截取字符串出现乱码问题解决方法[utf8与gb2312]
Dec 16 PHP
CodeIgniter框架过滤HTML危险代码
Jun 12 PHP
浅析php工厂模式
Nov 25 PHP
php项目开发中用到的快速排序算法分析
Jun 25 PHP
功能强大的php分页函数
Jul 20 PHP
PHP Cookie学习笔记
Aug 23 PHP
PHP实现批量检测网站是否能够正常打开的方法
Aug 23 PHP
PHP 7安装使用体验之性能大提升,兼容性强,扩展支持不够(升级PHP要谨慎)
Jul 27 PHP
PHP+MySQL实现消息队列的方法分析
May 09 PHP
PHP获取数据库表中的数据插入新的表再原删除数据方法
Oct 12 PHP
PHP完整的日历类(CLASS)
Nov 27 #PHP
PHP如何得到当前页和上一页的地址?
Nov 27 #PHP
PHP读写文件的方法(生成HTML)
Nov 27 #PHP
PHP date函数参数详解
Nov 27 #PHP
PHP 应用程序的安全 -- 不能违反的四条安全规则
Nov 26 #PHP
PHP中的cookie
Nov 26 #PHP
在PHP中使用与Perl兼容的正则表达式
Nov 26 #PHP
You might like
php去除字符串换行符示例分享
2014/02/13 PHP
ThinkPHP多表联合查询的常用方法
2020/03/24 PHP
Javascript中的异步编程规范Promises/A详细介绍
2014/06/06 Javascript
jQuery实现带玻璃流光质感的手风琴特效
2015/11/20 Javascript
jQuery+css实现非常漂亮的水平导航菜单效果
2016/07/27 Javascript
jQuery实现大图轮播
2017/02/13 Javascript
利用C/C++编写node.js原生模块的方法教程
2017/07/07 Javascript
教你用Cordova打包Vue项目的方法
2017/10/17 Javascript
NodeJS实现同步的方法
2019/03/02 NodeJs
详解使用Nuxt.js快速搭建服务端渲染(SSR)应用
2019/03/13 Javascript
Vue form表单动态添加组件实战案例
2019/09/02 Javascript
js实现无缝轮播图插件封装
2020/07/31 Javascript
[37:50]VP vs TNC Supermajor小组赛B组 BO3 第一场 6.2
2018/06/03 DOTA
[42:24]完美世界DOTA2联赛PWL S2 LBZS vs FTD.C 第三场 11.27
2020/12/01 DOTA
Python访问纯真IP数据库脚本分享
2015/06/29 Python
python多进程共享变量
2016/04/06 Python
python实现解数独程序代码
2017/04/12 Python
使用Python对微信好友进行数据分析
2018/06/27 Python
在Python中分别打印列表中的每一个元素方法
2018/11/07 Python
Python实现简单查找最长子串功能示例
2019/02/26 Python
快速排序的四种python实现(推荐)
2019/04/03 Python
关于Python内存分配时的小秘密分享
2019/09/05 Python
python解析xml文件方式(解析、更新、写入)
2020/03/05 Python
Python绘制组合图的示例
2020/09/18 Python
python批量生成条形码的示例
2020/10/10 Python
详解matplotlib绘图样式(style)初探
2021/02/03 Python
墨尔本照明批发商店:Mica Lighting
2017/12/28 全球购物
JD Sports马来西亚:英国领先的运动鞋和运动服饰零售商
2018/03/13 全球购物
Super-Pharm波兰:药房和香水在一个地方
2020/08/18 全球购物
后勤主管工作职责
2013/12/07 职场文书
精彩广告词大全
2014/03/19 职场文书
项目建议书模板
2014/05/12 职场文书
党的群众路线教育实践活动剖析材料
2014/09/30 职场文书
考试没考好检讨书
2015/05/06 职场文书
2016毕业实习单位评语大全
2015/12/01 职场文书
Redis高并发缓存架构性能优化
2022/05/15 Redis