源码网,源码论坛,源码之家,商业源码,游戏源码下载,discuz插件,棋牌源码下载,精品源码论坛

 找回密码
 立即注册
楼主: ttx9n

[PHP编程] php类

[复制链接]

7万

主题

861

回帖

32万

积分

论坛元老

Rank: 8Rank: 8

积分
329525
发表于 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 @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
 }
?>
回复

使用道具 举报

1

主题

2万

回帖

79

积分

注册会员

Rank: 2

积分
79
发表于 2022-8-30 04:59:58 | 显示全部楼层
66666666666
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-2-14 12:33:14 | 显示全部楼层
逛逛看看瞧瞧
回复 支持 反对

使用道具 举报

3

主题

2万

回帖

163

积分

注册会员

Rank: 2

积分
163
发表于 2023-2-23 22:23:37 | 显示全部楼层
看看看看
TS人妖演出表演服务q3268336102电话13168842816
回复 支持 反对

使用道具 举报

4

主题

2万

回帖

262

积分

中级会员

Rank: 3Rank: 3

积分
262
发表于 2023-3-18 01:29:44 | 显示全部楼层
收下来看看怎么样
回复 支持 反对

使用道具 举报

2

主题

2万

回帖

380

积分

中级会员

Rank: 3Rank: 3

积分
380
发表于 2023-7-8 02:34:03 | 显示全部楼层
飞飞飞飞飞飞飞飞飞飞飞飞飞
回复 支持 反对

使用道具 举报

0

主题

2万

回帖

66

积分

注册会员

Rank: 2

积分
66
发表于 2023-9-4 13:07:50 | 显示全部楼层
谢谢分享,先下来用用
回复 支持 反对

使用道具 举报

2

主题

2万

回帖

473

积分

中级会员

Rank: 3Rank: 3

积分
473
发表于 2023-9-15 02:40:27 | 显示全部楼层
激动人心,无法言表!
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

68

积分

注册会员

Rank: 2

积分
68
发表于 2023-9-15 19:32:19 | 显示全部楼层
dfdsafdsfdsfdsf
回复 支持 反对

使用道具 举报

0

主题

1万

回帖

0

积分

中级会员

Rank: 3Rank: 3

积分
0
发表于 2023-10-17 09:58:37 | 显示全部楼层
vcxvcxv
回复 支持 反对

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

手机版|小黑屋|网站地图|源码论坛 ( 海外版 )

GMT+8, 2025-2-4 08:42 , Processed in 0.101562 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表