类 php,php类

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 @@@@@@@@@@@@@@@@@@@@@@@@@\\\\\\\\

}

?>

相关文章

1a1b05c64693fbf380aa1344a7812747.png

这篇文章主要介绍了详解no input file specified 三种解决方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧2019-11-11

4f55910a645b073bc4fc65dc10dc14bd.png

这最近在做一个教育类的小商城的微信小程序,用到了上传多个图片文件到服务器端。下面脚本之家小编给大家带来了tp5实现微信小程序多图片上传到服务器的方法,需要的朋友可以参考下2018-07-07

0ea3c7666119d5615e582f823fb3fad6.png

FTP服务器(File Transfer Protocol Server)是在互联网上提供文件存储和访问服务的计算机,它们依照FTP协议提供服务,本文给大家介绍使用PHP如何实现高效安全的ftp服务器(一),对php ftp服务器相关知识感兴趣的朋友一起学习吧2015-12-12

4f96a78db829b1556ff16de21e013c7a.png

这篇文章主要介绍了Yii框架中sphinx索引配置方法,较为详细的分析了sphinx索引配置的步骤与相关操作技巧,需要的朋友可以参考下2016-10-10

8cc1031babc6aff2319f1c6af8544aa0.png

这篇文章主要介绍了thinkPHP3.2实现分页自定义样式的方法,结合实例形式分析了thinkPHP3.2针对底层框架代码的修改与使用相关操作技巧,需要的朋友可以参考下2018-01-01

0c932a99bb7b6f23c937db507070cc7b.png

这篇文章主要给大家介绍了利用PHP实现一个简单的用户登记表的相关资料,文中分别介绍了如何展示单行和多行信息表的实现方法,分别给出了详细的示例代码,需要的朋友可以参考简介,下面来一起看看吧。2017-04-04

cca732bf65a93ed2ec0ac80c638460fe.png

上传图片直接缩放的话就会导致图片变形,这样体验肯定就不好了。下面提供一种解决方法,缩小后添加白边的方法看下面的代码实现2013-12-12

2d9f31f2af7b675a3d153d2b7f1035a7.png

本篇文章主要介绍了Laravel5.* 打印出执行的sql语句的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2017-07-07

b452cee8ec5cd9e58ab98eba17281e59.png

下面小编就为大家带来一篇PHP利用超级全局变量$_GET来接收表单数据的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2016-11-11

f4838ec7e2d4da28e0b57d4e852dadd4.png

这篇文章主要介绍了PHP 断点续传的相关知识,非常不错,具有参考借鉴价值,需要的朋友可以参考下2017-11-11

最新评论

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值