[] Integrating ThinkPHP with FIREPHP

Source: Internet
Author: User
[] Integration of ThinkPHP with FIREPHP, haha & nbsp; tp debugging is really silly and difficult to use. to output trace information, the conditions are as follows: 1. set app_debug and show_page_trace to true, 2. the action must have a view. here, I realized my imagination and finally integrated firephp. hahaha, the method is as follows: [replace [] ThinkPHP and integrate FIREPHP.
Tp debugging is really silly and difficult to use. to output trace information, the conditions are as follows: 1. set app_debug and show_page_trace to true, 2. the action must have a view. here, I realized my imagination and finally integrated firephp. hahaha, the method is as follows: [replace thinkphp/lib/think/core/log. class. php] class put firephp. class. copy php to the thinkphp/lib/think/core directory and modify the following method: [We recommend that you back up the original file. this is only for testing.] static function record ($ message, $ level = self: err, $ record = false) {if ($ record | in_array ($ level, c ('log _ record_level '))) {$ now = date (self: $ format); self: $ log [] = "{$ now} {$ level }: {$ message} \ r \ n "; switch ($ level) {case self: debug: firephp: getinstance (true)-> trace ($ message, $ level ); break; case self: info: firephp: getinstance (true)-> log ($ message, $ level); break; case self: SQL: firephp :: getinstance (true)-> info ($ message, $ level); break; case self: notice: case self: warn: firephp: getinstance (true) -> warn ($ message, $ level); break; default: firephp: getinstance (true)-> error ($ message, $ level); break ;}}} for SQL output, because thinkphp/lib/think/db. class. in php, Line 5 is dead of debugging parameters and must be bound to c ('app _ debug'). it is hard to understand. here, we modify it to add a custom one, does not conflict with the original one .. the code is as follows: if (c ('app _ debug') | c ('log _ record_ SQL ') make the following options in the configuration file: 'log _ record '=> true, // logs 'log _ record_ SQL' => true, // perform log record 'log _ record_level '=> array ('erg', 'Alert', 'crit', 'err', 'warn', 'notic ', 'info', 'debug', 'SQL'), // you can increase or decrease the log level that can be recorded.
?

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.