php类

 更新时间:2006年11月27日 00:00:00   作者:  
<?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 @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
 }
?>

相关文章

  • ThinkPHP 3.2 数据分页代码分享

    ThinkPHP 3.2 数据分页代码分享

    这篇文章主要分享给大家一段ThinkPHP 3.2 数据分页代码,非常的简单好用,有需要当朋友参考下
    2014-10-10
  • 熊海CMS代码审计漏洞分析

    熊海CMS代码审计漏洞分析

    这篇文章主要为大家介绍了熊海CMS代码审计漏洞分析,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2023-02-02
  • PHP实现链式操作的原理详解

    PHP实现链式操作的原理详解

    下面小编就为大家带来一篇PHP实现链式操作的原理详解。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2016-09-09
  • PHP实现上传图片到 zimg 服务器

    PHP实现上传图片到 zimg 服务器

    zimg是一个具有图片处理功能的图片存储服务,你可以上传图片到zimg服务器,然后通过带有参数的URL来获取被处理过的图片,今天我们的主要内容是使用php实现图片上传到zimg服务器上,希望大家能够喜欢
    2016-10-10
  • PHP laravel中的多对多关系实例详解

    PHP laravel中的多对多关系实例详解

    数据表之间是纵横交叉、相互关联的,laravel的一对一,一对多比较好理解,本文重点通过实例给大家讲解 laravel中的多对多关系,感兴趣的朋友一起看看吧
    2017-06-06
  • PHP安装Swoole支持DTLS协议步骤

    PHP安装Swoole支持DTLS协议步骤

    这篇文章主要为大家介绍了PHP安装Swoole支持DTLS协议步骤示例,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2022-07-07
  • PHP使用Guzzle发起的异步请求示例详解

    PHP使用Guzzle发起的异步请求示例详解

    这篇文章主要为大家介绍了PHP使用Guzzle发起的异步请求示例详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2023-06-06
  • php的zip解压缩类pclzip使用示例

    php的zip解压缩类pclzip使用示例

    PclZip是一个很强大的压缩与解压缩zip文件的PHP类,这篇文章主要介绍了PclZip的使用方法
    2014-03-03
  • ThinkPHP页面跳转success与error方法概述

    ThinkPHP页面跳转success与error方法概述

    这篇文章主要介绍了ThinkPHP页面跳转success与error方法概述,需要的朋友可以参考下
    2014-06-06
  • THINKPHP5.1 Config的配置与获取详解

    THINKPHP5.1 Config的配置与获取详解

    这篇文章主要介绍了THINKPHP5.1 Config的配置与获取详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-06-06

最新评论