VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > PHP >
  • PHP顶层类

  1. <?php 
  2. /** 
  3. * Object 
  4. * base class 
  5. */ 
  6. class Object 
  7. { 
  8. /* 是否输出调试信息 */ 
  9. var $debug = true; 
  10.  
  11. /** 
  12. * Object 
  13. * @deprecated 析构方法 
  14. * 
  15. * @return void 
  16. */ 
  17. function Object() 
  18. { 
  19. //用户是否从主页进入,做判定 
  20. if ( !defined( 'INDEX' ) ) 
  21. { 
  22. die( "Hacking attempt" ); 
  23. } 
  24. //echo 'create Object success!'; 
  25. } 
  26.  
  27. /** 
  28. * msg_die 
  29. * @deprecated 调试信息输出 
  30. * @param string 
  31. * @return void 
  32. */ 
  33. function msg_die( $info , $file , $line ) 
  34. { 
  35. if( $this->debug ) 
  36. { 
  37. $format = "There is happen error information: %s .". 
  38. " the file name: %s , on line : %s . "; 
  39. printf( $format , $info , $file , $line ); 
  40. $error = debug_backtrace(); 
  41. print_r ( $error[0] ); 
  42. } 
  43. } 
  44.  
  45. /** 
  46. * setDebug 
  47. * @deprecated 设置是否输出调试信息 
  48. * @param boolean true or false 
  49. * @return void 
  50. */ 
  51. function setDebug( $bool ) 
  52. { 
  53. $this->debug = is_bool( $bool ) ? $bool : false ; 
  54. } 
  55.  
  56. /** 
  57. * getDebug * @deprecated 查看是否打开调试信息 
  58. * @param void 
  59. * @return boolean 
  60. */ 
  61. function getDebug() 
  62. { 
  63. return $this->debug; 
  64. } 
  65. } 
  66. ?>
  67.  

出处:http://www.phpfensi.com/php/20131210/906.html


相关教程