ThinkPHP learning notes debugging mode and logging
Source: Internet
Author: User
Under the gorgeous split line, you need to modify and configure the specific implementation method: cong. php [php] & lt ;? Phpreturnarray (// it is best to delete some of the replace mode ~ App. php and ~ Runtime. php // & amp; #39; configuration item & amp; #39 ;=& gt; & amp; #39; configuration value & amp; #39; // the specific implementation method of modifying and configuration is required to enable URL duplication under the gorgeous split line: cong. php [php] 'Configuration value' // because the URL is enabled again, whether it is overwritten or not, it can be accessed through the original path. // If you want to enable the rewrite mode, perform the following operations // 1. the query server has enabled the Apache rewrite module // LoadModule rewrite_module modules/mod_rewrite.so // 2. create a new one under the statistics Directory of the master Portal file. htaccess (vi: save. htaccess; notepad :". htaccess ") // If you select mode 2 (rewrite), the server will consume more 'URL _ model' => 1, 'URL _ PATNINFO_MODEL '=> 2, // pathinfo contains two classes // 1 Normal mode: m and a: The order relationship can change // http://localhost/MyThinkPHP/admin.php/m/index/a/index // Pass the value // http://localhost/MyThinkPHP/admin.php/m/index/a/index /Username/zhangsan/password // 2 intelligent recognition module operation (the default mode is intelligent recognition )// http://localhost/MyThinkPHP/admin.php/index/index // Pass the value // http://localhost/MyThinkPHP/admin.php/index/index /Username/zhangsan/password // modify the URL separator // 'URL _ pathinfo_depr' => '-', // modify the left and right delimiters of the template 'tmpl _ L_DELIM '=>' ', // ************************************ Very gorgeous split line ** *********************************** // enable debugging mode // 1. simulate a linux system to identify the case. // 2. the case sensitivity of the method name is related to the case sensitivity of the template file 'app _ debug' => true, // You can customize the Trace information of the page. // The Trace information of the configuration file path is configured in pageTrace under Thinkphp/Tpl. tpl. php // custom method: // 'tmpl _ TRACE_FILE '=> APP_PATH. '/Public/trace. php ', // or custom trace. put the php page in the current Conf folder // Default debugging file location: // ThinkPHP/Common/debug. php // do not cache database fields; if enabled, you can delete the files under Runtim/Data/ /'DB _ FIELDS_CACHE '=> false, // debug that can be customized. put php in the current Conf folder // Set APP_DEBUG to false and add the following parameter // 'app _ debug' => false, // Display running times the time required for this page // 'show _ RUN_TIME '=> true, // display the detailed running time (based on SHOW_RUN_TIME) // 'show _ ADV_TIME '=> true, // display the number of database operations (based on SHOW_RUN_TIME) // 'show _ DB_TIMES' => true, // display the number of cached operations (based on SHOW_RUN_TIME) // 'show _ CACHE_TIMES '=> true, // display the memory overhead (based on SHOW_RUN_TIME) // 'show _ USE_MEM '=> true, // set the template // 'default _ THEME' => 'Def Ault ', // log processing log class: lib/Think/Core/log. class. php // enable the LOG 'log _ RECORD '=> true, // log processing class: lib/Think/Core/log. class. php has a processing level. you can choose to add 'log _ RECORD_LEVEL '=> array ('emerg', 'Alert '),);?> Use [php] in the action: // Model debugging (the operation statement executed in the database) $ User = new Model ('user'); $ User-> find (1 ); // Obtain the last executed SQL echo $ User-> getLastSql (); // Use: Log information, Log level, Log type, and specific information Log :: write ("aa", $ level, $ type, $ file); // The record method writes information to the memory.
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.