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 相关文章推荐
php的正则处理函数总结分析
Jun 20 PHP
phpMyAdmin 链接表的附加功能尚未激活问题的解决方法(已测)
Mar 27 PHP
基于PHP异步执行的常用方式详解
Jun 03 PHP
PHP中通过fopen()函数访问远程文件示例
Nov 18 PHP
PHP实现获取中英文首字母
Jun 19 PHP
PHP获取二维数组中某一列的值集合
Dec 25 PHP
php版微信公众号接口实现发红包的方法
Oct 14 PHP
php查询及多条件查询
Feb 26 PHP
thinkphp分页集成实例
Jul 24 PHP
ThinkPHP3.2.3框架实现执行原生SQL语句的方法示例
Apr 03 PHP
TP5框架实现签到功能的方法分析
Apr 05 PHP
PHP中abstract(抽象)、final(最终)和static(静态)原理与用法详解
Jun 05 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通用检测函数集合
2006/11/25 PHP
基于php使用memcache存储session的详解
2013/06/25 PHP
用PHP和Shell写Hadoop的MapReduce程序
2014/04/15 PHP
PHP易混淆函数的区别及用法汇总
2014/11/22 PHP
php实现数据库的增删改查
2017/02/26 PHP
Yii支持多域名cors原理的实现
2018/12/05 PHP
php项目中类的自动加载实例讲解
2019/09/12 PHP
Aster vs KG BO3 第三场2.19
2021/03/10 DOTA
说说掌握JavaScript语言的思想前提想学习js的朋友可以看看
2009/04/01 Javascript
限制复选框最多选择项的实现代码
2016/05/30 Javascript
基于BootstrapValidator的Form表单验证(24)
2016/12/12 Javascript
微信小程序顶部导航栏可滑动并选中放大
2019/12/05 Javascript
vue element 关闭当前tab 跳转到上一路由操作
2020/07/22 Javascript
Vue获取微博授权URL代码实例
2020/11/04 Javascript
[03:38]2014DOTA2西雅图国际邀请赛 VG战队巡礼
2014/07/07 DOTA
[50:04]DOTA2上海特级锦标赛D组小组赛#2 Liquid VS VP第二局
2016/02/28 DOTA
[04:31]2016国际邀请赛中国区预选赛妖精采访
2016/06/27 DOTA
Python中使用glob和rmtree删除目录子目录及所有文件的例子
2014/11/21 Python
在SAE上部署Python的Django框架的一些问题汇总
2015/05/30 Python
CentOS中使用virtualenv搭建python3环境
2015/06/08 Python
使用Python的Flask框架构建大型Web应用程序的结构示例
2016/06/04 Python
Python获取指定文件夹下的文件名的方法
2018/02/06 Python
python中的数据结构比较
2019/05/13 Python
python中数组和矩阵乘法及使用总结(推荐)
2019/05/18 Python
Python获取、格式化当前时间日期的方法
2020/02/10 Python
北美领先的牛仔品牌:Buffalo David Bitton
2017/05/22 全球购物
全球酒店比价网:HotelsCombined
2017/06/20 全球购物
某公司.Net方向面试题
2014/04/24 面试题
怎么写有吸引力的自荐信
2013/11/17 职场文书
查摆剖析材料范文
2014/09/30 职场文书
学生检讨书怎么写?
2014/10/10 职场文书
2014年英语教师工作总结
2014/12/03 职场文书
民主评议党员个人自我评价
2015/03/03 职场文书
如何给HttpServletRequest增加消息头
2021/06/30 Java/Android
ORACLE中dbms_output.put_line输出问题的解决过程
2022/06/28 Oracle
python如何将mat文件转为png
2022/07/15 Python