程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> PHP頂層類

PHP頂層類

編輯:關於PHP編程

<?php
/**
* Object
* base class
*/
class Object
{
/* 是否輸出調試信息 */
var $debug = true;

/**
* Object
* @deprecated 析構方法
*
* @return void
*/
function Object()
{
//用戶是否從主頁進入,做判定
if ( !defined( 'INDEX' ) )
{
die( "Hacking attempt" );
}
//echo 'create Object success!';
}

/**
* msg_die
* @deprecated 調試信息輸出
* @param string
* @return void
*/
function msg_die( $info , $file , $line )
{
if( $this->debug )
{
$format = "There is happen error information: %s .".
" the file name: %s , on line : %s . ";
printf( $format , $info , $file , $line );
$error = debug_backtrace();
print_r ( $error[0] );
}
}

/**
* setDebug
* @deprecated 設置是否輸出調試信息
* @param boolean true or false
* @return void
*/
function setDebug( $bool )
{
$this->debug = is_bool( $bool ) ? $bool : false ;
}

/**
* getDebug * @deprecated 查看是否打開調試信息
* @param void
* @return boolean
*/
function getDebug()
{
return $this->debug;
}
}
?>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved