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 相关文章推荐
生成缩略图
Oct 09 PHP
用户的详细注册和判断
Oct 09 PHP
php录入页面中动态从数据库中提取数据的实现
Oct 09 PHP
PHP下编码转换函数mb_convert_encoding与iconv的使用说明
Dec 16 PHP
zf框架的数据库追踪器使用示例
Mar 13 PHP
PHP编译安装中遇到的两个错误和解决方法
Aug 20 PHP
PHP通过内置函数memory_get_usage()获取内存使用情况
Nov 20 PHP
ThinkPHP中公共函数路径和配置项路径的映射分析
Nov 22 PHP
php计算两个文件相对路径的方法
Mar 14 PHP
常用PHP封装分页工具类
Jan 14 PHP
cakephp常见知识点汇总
Feb 24 PHP
Laravel框架用户登陆身份验证实现方法详解
Sep 14 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 上传功能实例代码
2010/04/13 PHP
php封装的验证码类分享
2017/02/26 PHP
php微信开发之关注事件
2018/06/14 PHP
JQuery UI的拖拽功能实现方法小结
2012/03/14 Javascript
Jquery AJAX POST与GET之间的区别
2013/11/14 Javascript
javascript计时器事件使用详解
2014/01/07 Javascript
javascript window.open打开新窗口后无法再次打开该窗口问题的解决方法
2014/04/12 Javascript
实现网页页面跳转的几种方法(meta标签、js实现、php实现)
2014/05/20 Javascript
node.js中的fs.createReadStream方法使用说明
2014/12/17 Javascript
jQuery AjaxUpload 上传图片代码
2016/02/02 Javascript
浅谈JS读取DOM对象(标签)的自定义属性
2016/11/21 Javascript
Mongoose经常返回e11000 error的原因分析
2017/03/29 Javascript
Vue实现导出excel表格功能
2018/03/30 Javascript
Vue封装的可编辑表格插件方法
2018/08/28 Javascript
vue+elementUi 实现密码显示/隐藏+小图标变化功能
2020/01/18 Javascript
十分钟教你上手ES2020新特性
2020/02/12 Javascript
JS实现京东商品分类侧边栏
2020/12/11 Javascript
vue中使用echarts的示例
2021/01/03 Vue.js
python算法学习之桶排序算法实例(分块排序)
2013/12/18 Python
使用Python的内建模块collections的教程
2015/04/28 Python
python基于socket实现网络广播的方法
2015/04/29 Python
有趣的python小程序分享
2017/12/05 Python
Python3实现的字典遍历操作详解
2018/04/18 Python
使用Py2Exe for Python3创建自己的exe程序示例
2018/10/31 Python
django小技巧之html模板中调用对象属性或对象的方法
2018/11/30 Python
Python如何使用k-means方法将列表中相似的句子归类
2019/08/08 Python
python基于plotly实现画饼状图代码实例
2019/12/16 Python
Python xlwings插入Excel图片的实现方法
2021/02/26 Python
用纯css3和html制作泡沫对话框实现代码
2013/03/21 HTML / CSS
自荐信格式的六要素
2013/09/21 职场文书
夏季奶茶店创业计划书
2014/01/16 职场文书
公司户外活动总结
2014/07/04 职场文书
七一党日活动总结
2014/07/08 职场文书
结婚十年感言
2015/07/31 职场文书
实用求职信模板范文
2019/05/13 职场文书
Python实战之大鱼吃小鱼游戏的实现
2022/04/01 Python