Solution to incomplete display of ThinkPHP debugging mode information

Source: Internet
Author: User
When ThinkPHP calls the debugging mode, it does not know why it only displays page trace information, but does not display the page running time and database query time as TP itself said, go to brothers, QQ and ThinkPHP official website to ask questions.

When ThinkPHP calls the debugging mode, it does not know why it only displays page trace information, but does not display the page running time and database query time as TP itself said, I ran to the brothers, QQ, and ThinkPHP official website to ask questions. here I despise ThinkPHP official website forums, and I have solved them myself. I am sorry for my post, it's still under review ...... It's no wonder that it's so cool to speak.

In general, PageTrace. tpl. php, which is responsible for page trace information display, does not contain the code for displaying the running time and number of database queries. this is simple and I can add it to it.

Add the following code to the file:

  1. $ ShowTime = 'runtime: '. G ('begintime', 'viewendtime'). s ';
  2. $ ShowTime. = '(load :'. G ('begintime', 'loadtime ').'s Insert :'. G ('loadtime', 'inittime ').'s explanation :'. G ('inittime', 'viewstarttime ').'s Template :'. G ('viewstarttime', 'viewendtime '). 's) '; $ showTime. = '| database :'. N ('Db _ query '). 'query '. N ('Db _ write '). 'write ';
  3. $ ShowTime. = '| cache:'. N ('cache _ READ'). 'read'. N ('cache _ write'). 'write ';
  4. $ StartMem = array_sum (explode ('', $ GLOBALS ['_ startUseMems']);
  5. $ EndMem = array_sum (explode ('', memory_get_usage (); $ showTime. = '| memory usage :'. number_format ($ endMem-$ startMem)/1024 ). 'KB'; echo' '. $ ShowTime .'

    ';

Run it again ~ See how.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.