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 相关文章推荐
不用数据库的多用户文件自由上传投票系统(3)
Oct 09 PHP
PHP设置一边执行一边输出结果的代码
Sep 30 PHP
Destoon模板制作简明教程
Jun 20 PHP
phpmyadmin出现Cannot start session without errors问题解决方法
Aug 14 PHP
关于PHP转换超过2038年日期出错的问题解决
Jun 28 PHP
Laravel学习教程之View模块详解
Sep 18 PHP
PHP 的Opcache加速的使用方法
Dec 29 PHP
PHP生成(支持多模板)二维码海报代码
Apr 30 PHP
thinkPHP5框架实现基于ajax的分页功能示例
Jun 12 PHP
php获取手机端的号码以及ip地址实例代码
Sep 12 PHP
laravel 输出最后执行sql 附:whereIn的使用方法
Oct 10 PHP
PHP设计模式(九)外观模式Facade实例详解【结构型】
May 02 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&amp;&amp;mysql)一
2006/10/09 PHP
phpphp图片采集后按原路径保存图片示例
2014/02/18 PHP
php采集中国代理服务器网的方法
2015/06/16 PHP
php数据访问之增删改查操作
2016/05/09 PHP
JAVASCRIPT车架号识别/验证函数代码 汽车车架号验证程序
2012/01/08 Javascript
如何用ajax来创建一个XMLHttpRequest对象
2012/12/10 Javascript
为什么要在引入的css或者js文件后面加参数的详细讲解
2013/05/03 Javascript
IE中鼠标经过option触发mouseout的解决方法
2015/01/29 Javascript
jquery删除table当前行的实例代码
2016/10/07 Javascript
在Vue项目中引入腾讯验证码服务的教程
2018/04/03 Javascript
JS实现获取当前所在周的周六、周日示例分析
2019/05/11 Javascript
微信小程序 冒泡事件原理解析
2019/09/27 Javascript
Vue通过配置WebSocket并实现群聊功能
2019/12/31 Javascript
js 将多个对象合并成一个对象 assign方法的实现
2020/09/24 Javascript
Python实现在线程里运行scrapy的方法
2015/04/07 Python
基于Python log 的正确打开方式
2018/04/28 Python
Python 给屏幕打印信息加上颜色的实现方法
2019/04/24 Python
Tensorflow实现神经网络拟合线性回归
2019/07/19 Python
python实现京东订单推送到测试环境,提供便利操作示例
2019/08/09 Python
Python 元组操作总结
2019/09/18 Python
python学生信息管理系统实现代码
2019/12/17 Python
pytorch1.0中torch.nn.Conv2d用法详解
2020/01/10 Python
Selenium 滚动页面至元素可见的方法
2020/03/18 Python
Pycharm pyuic5实现将ui文件转为py文件,让UI界面成功显示
2020/04/08 Python
AVON雅芳官网:世界上最大的美容化妆品公司之一
2016/11/02 全球购物
毕业生教师求职信
2013/10/20 职场文书
技术总监岗位职责
2013/12/05 职场文书
助人为乐表扬信范文
2014/01/14 职场文书
双方协议书
2014/04/22 职场文书
优秀应届生求职信
2014/06/16 职场文书
战略性融资合作协议书范本
2014/10/17 职场文书
不尊敬老师检讨书范文
2014/11/19 职场文书
工程款申请报告
2015/05/15 职场文书
亮剑观后感300字
2015/06/05 职场文书
七一活动主持词
2015/06/29 职场文书
Unity连接MySQL并读取表格数据的实现代码
2021/06/20 MySQL