导读:
?php ***Object*baseclass* classObject{ *是否输出调试信息* var$debug=true; ***Object*@deprecated析构方法**@returnvoid* functionObj...
PHP顶层类
-
-
-
-
- class Object
- {
-
- var $debug = true;
-
-
-
-
-
-
-
- function Object()
- {
-
- if ( !defined( 'INDEX' ) )
- {
- die( "Hacking attempt" );
- }
-
- }
-
-
-
-
-
-
-
- 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] );
- }
- }
-
-
-
-
-
-
-
- function setDebug( $bool )
- {
- $this->debug = is_bool( $bool ) ? $bool : false ;
- }
-
-
-
-
-
-
- function getDebug()
- {
- return $this->debug;
- }
- }
- ?>