php专区

 首页 > php专区 > PHP应用 > php类库 > PHP顶层类 - php类库

PHP顶层类 - php类库

分享到:
【字体:大 中 小】
导读:
          ?php ***Object*baseclass* classObject{ *是否输出调试信息* var$debug=true; ***Object*@deprecated析构方法**@returnvoid* functionObj...

PHP顶层类

  1. /** 
  2. * Object 
  3. * base class 
  4. */ 
  5. class Object 
  6. { 
  7. /* 是否输出调试信息 */ 
  8. var $debug = true; 
  9.  
  10. /** 
  11. * Object 
  12. * @deprecated 析构方法 
  13. * 
  14. * @return void 
  15. */ 
  16. function Object() 
  17. { 
  18. //用户是否从主页进入,做判定 
  19. if ( !defined( 'INDEX' ) ) 
  20. { 
  21. die( "Hacking attempt" ); 
  22. } 
  23. //echo 'create Object success!'; 
  24. } 
  25.  
  26. /** 
  27. * msg_die 
  28. * @deprecated 调试信息输出 
  29. * @param string 
  30. * @return void 
  31. */ 
  32. function msg_die( $info , $file , $line ) 
  33. { 
  34. if( $this->debug ) 
  35. { 
  36. $format = "There is happen error information: %s .". 
  37. " the file name: %s , on line : %s . "; 
  38. printf( $format , $info , $file , $line ); 
  39. $error = debug_backtrace(); 
  40. print_r ( $error[0] ); 
  41. } 
  42. } 
  43.  
  44. /** 
  45. * setDebug 
  46. * @deprecated 设置是否输出调试信息 
  47. * @param boolean true or false 
  48. * @return void 
  49. */ 
  50. function setDebug( $bool ) 
  51. { 
  52. $this->debug = is_bool( $bool ) ? $bool : false ; 
  53. } 
  54.  
  55. /** 
  56. * getDebug * @deprecated 查看是否打开调试信息 
  57. * @param void 
  58. * @return boolean 
  59. */ 
  60. function getDebug() 
  61. { 
  62. return $this->debug; 
  63. } 
  64. } 
  65. ?>
分享到:
phpword中文字符乱码解决办法 - php类库
phpword中文字符乱码解决办法 最近领导要求用php生成word,网上找了很多类啊,函数啊,最终相中phpword,无奈不是国人开发,对中文支持很不友好,经过研究,终于解决了中文乱码,分享出来。 1、用模板word生成word中文乱码解决方案:打开phpword/Template.php文件,找到$replace = utf8_encode($repl...
PHP多功能图片处理类 - php类库
PHP多功能图片处理类 setSrcImg("img/test.jpg");          $t->setCutType(1);//这一句就OK了          $t->setDstImg("tmp/new_test.jpg");          $t->createImg(60,60);                 手工裁切:          程序会按照...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……