sqlcontrol.init.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. if (!defined('IS_INITPHP')) exit('Access Denied!');
  3. /*********************************************************************************
  4. * InitPHP 3.8.1 国产PHP开发框架 - 工具库-sql监控
  5. *-------------------------------------------------------------------------------
  6. * 版权所有: CopyRight By initphp.com
  7. * 您可以自由使用该源码,但是在使用过程中,请保留作者信息。尊重他人劳动成果就是尊重自己
  8. *-------------------------------------------------------------------------------
  9. * Author:zhuli Dtime:2014-11-25
  10. ***********************************************************************************/
  11. class sqlcontrolInit {
  12. /**
  13. * 数据库语句监控器-开始点
  14. * 使用方法:$this->getUtil('sqlcontrol')->start();
  15. * @return string
  16. */
  17. public function start() {
  18. InitPHP::setConfig('issqlcontrol', 1);
  19. }
  20. /**
  21. * 数据库语句监控器-结束点
  22. * 使用方法:$this->getUtil('sqlcontrol')->end();
  23. * @return string
  24. */
  25. public function end() {
  26. $InitPHP_conf = InitPHP::getConfig();
  27. if (isset($InitPHP_conf['sqlcontrolarr']) && is_array($InitPHP_conf['sqlcontrolarr'])) {
  28. $i = 1;
  29. echo '<div style=" border:1px #000000 dotted; width:100%; background-color:#EEEEFF">';
  30. foreach ($InitPHP_conf['sqlcontrolarr'] as $k => $v) {
  31. echo '<div style=" height:20px; text-align:left; font-size:14px; margin-left:10px;margin-top:5px;"><span>'.$i.'.&nbsp;&nbsp;&nbsp;&nbsp;</span>' . $v . '</div>';
  32. $i++;
  33. }
  34. echo '</div>';
  35. }
  36. }
  37. }