<?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 @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
}
?>
/*----------------------------------------------------------------//
* 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类
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“php类”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。