php类
更新时间:2006年11月27日 00:00:00 作者:
/*----------------------------------------------------------------//
* 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 "" . $msg . "\n
";
}
/*
* 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 @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\
}
?>
相关文章
这篇文章主要介绍了详解no input file specified 三种解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2019-11-11
这最近在做一个教育类的小商城的微信小程序,用到了上传多个图片文件到服务器端。下面脚本之家小编给大家带来了tp5实现微信小程序多图片上传到服务器的方法,需要的朋友可以参考下2018-07-07
FTP服务器(File Transfer Protocol Server)是在互联网上提供文件存储和访问服务的计算机,它们依照FTP协议提供服务,本文给大家介绍使用PHP如何实现高效安全的ftp服务器(一),对php ftp服务器相关知识感兴趣的朋友一起学习吧2015-12-12
这篇文章主要介绍了Yii框架中sphinx索引配置方法,较为详细的分析了sphinx索引配置的步骤与相关操作技巧,需要的朋友可以参考下2016-10-10
这篇文章主要介绍了thinkPHP3.2实现分页自定义样式的方法,结合实例形式分析了thinkPHP3.2针对底层框架代码的修改与使用相关操作技巧,需要的朋友可以参考下2018-01-01
这篇文章主要给大家介绍了利用PHP实现一个简单的用户登记表的相关资料,文中分别介绍了如何展示单行和多行信息表的实现方法,分别给出了详细的示例代码,需要的朋友可以参考简介,下面来一起看看吧。2017-04-04
上传图片直接缩放的话就会导致图片变形,这样体验肯定就不好了。下面提供一种解决方法,缩小后添加白边的方法看下面的代码实现2013-12-12
本篇文章主要介绍了Laravel5.* 打印出执行的sql语句的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-07-07
下面小编就为大家带来一篇PHP利用超级全局变量$_GET来接收表单数据的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2016-11-11
这篇文章主要介绍了PHP 断点续传的相关知识,非常不错,具有参考借鉴价值,需要的朋友可以参考下2017-11-11
最新评论