ThinkPHP learning notes (4) debugging mode and logging must be modified and configured under the gorgeous splitting line: cong. php & lt ;? Phpreturnarray ~ App. php and ~ Runtime. php configuration item & gt; the configuration value can access ThinkPHP learning notes (4) debugging mode and logging through the original path because the URL is enabled again, whether it is overwritten or not.
Under the gorgeous split line is the specific implementation method that needs to be modified and can be configured:
Cong. 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 identification module operation (intelligent identification is the default mode) // http: // localhost/MyThinkPHP/admin. php/index // pass the value // http: // localhost/MyThinkPHP/admin. php/index/username/zhangsan/password // modify the URL separator // 'URL _ pathinfo_depr' => '-', // modify the left and right delimers 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 // The database fields are not cached. If enabled, you can delete the files under Runtim/Data and modify them. // 'DB _ FIELDS_CA CHE '=> false, // customizable debug. 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' => 'default', // log processing class: lib/Think/Co Re/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 in action:
// Model debugging (the operation statement executed in the database) $ User = new Model ('user'); $ User-> find (1 ); // Obtain the last executed sqlecho $ User-> getLastSql (); // Use: Log information, Log level, Log type, specific information Log: write ("aa ", $ level, $ type, $ file); // The record method writes information to the memory.