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:
- $ ShowTime = 'runtime: '. G ('begintime', 'viewendtime'). s ';
- $ 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 ';
- $ ShowTime. = '| cache:'. N ('cache _ READ'). 'read'. N ('cache _ write'). 'write ';
- $ StartMem = array_sum (explode ('', $ GLOBALS ['_ startUseMems']);
- $ EndMem = array_sum (explode ('', memory_get_usage (); $ showTime. = '| memory usage :'. number_format ($ endMem-$ startMem)/1024 ). 'KB'; echo' '. $ ShowTime .' ';
Run it again ~ See how.