php잚

2018-09-07 13:28

阅读:253

  <?php
/*----------------------------------------------------------------//
*Class::Ini
*Function::toinstallthesystemwhichisrequestedfromclient
*Author::Kevin#
*QQ::84529890
*Date::2006.10.24
//----------------------------------------------------------------*/
require_once(CLASS_SYS_PATH.class.db.php);
classIni{
/*
*membervariable$defaultPlay
*tosetthevariableplay
*/
var$defaultPlay=main;
/*
*membervariable$DB
*tosettheobject:database
*/
var$DB;
/*
*membervariable$play
*recordtheparameterofplay
*/
var$play;
//////@@@@MEMBERFUNCTIONLIST@@@@\\\\\\\
//-======================================-\\
//LastModifyTime::2006.11.16
//-======================================-\\
////////////////////////////////////////////
/*
*function::setDB($db)
*settheglobaldatabaseobject
*/
functionsetDB($db){
return$this->DB=$db;
}
/*
*function::loadSystem($play)
*loadsystem
*/
functionloadSystem($play){
if($this->isValidPlay($play)){
require_once(class.smarttemplate.php);
require_once($play);
$playLikeABird=newMain;
}else{
$this->halt(InvalidAccess....);
}
}
/*
*function::iniCon()
*installdatabase
*/
functioniniCon(){
global$DB;
$DB=newDB(HOST_ADDR,HOST_USER,HOST_PSW,DB_NAME);
}
/*
*function::getDB()
*togetthecurrentdatabaseobject
*/
functiongetDB(){
return$this->DB;
}
/*
*function::getPlay()
*gettheplaywhichispostfromclient
*/
functiongetPlay(){
return$play=empty($_REQUEST[play])?$this->defaultPlay:$_REQUEST[play];
}
/*
*function::isValidPlay($play)
*tochecklegitimacyiftheplayparameteris
*/
functionisValidPlay($play){
if(file_exists($play)){
returntrue;
}else{
returnfalse;
}
}
/*
*function::halt($msg)
*showmessageonthebrowser
*/
functionhalt($msg){
echo<fontcolor=\#FF0000\>.$msg.</font>\n<br/>;
}
/*
*function::iniSystem()
*installsystem
*/
functioniniSystem(){
$this->iniCon();
$this->setDB($DB);
$play=$this->getPlay();
return$play=$this->resetPlay($play);
}
/*
*function::resetPlay($p)
*tore-definetheplaysparameter
*/
functionresetPlay($p){
return$p=CLASS_PATH.ENTRY_FIRST_FORMAT.$p.ENTRY_LAST_FORMAT;
}
/*
*function::Ini()
*tolinkthedatabaseandgettheplaywhichpostfromclient
*/
functionIni(){
$play=$this->iniSystem();
$this->Debug($play);
$this->loadSystem($play);
$this->close();
}
/*
*function::debug($play)
*toshowthedebuginformation
*/
functiondebug($play){
if(DEBUG)$this->halt(Play->$play);
}
/*
*function::close()
*unsetdatabase
*/
functionclose(){
return$this->DB=NULL;
}
///////@@@@@@@@@@@@@@@@@@@@@@@@@defineclassover@@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
}
?>


评论


亲,登录后才可以留言!