This article describes how to enable the debugging mode of thinkphp to cancel cache generation. For more information, see this article.
Recently, I returned to thinkphp and found that the two files in the "common" mentioned in the earlier version of "Disable cache" were missing. I have been searching for a long time and don't know what's going on.
So I went to the manual and read Baidu. Later I found that I can enable the debugging mode to disable caching, and enable the debugging mode has many advantages for programmers ..
Search and debug two words in the thinkphp3.0 full development manual, and you will find many tips. The following describes how to enable the debugging function.
Although the compilation cache is excellent, it is not conducive to debugging and troubleshooting during the development phase. We strongly recommend that ThinkPHP developers always enable the debugging mode during the development phase, it is convenient to promptly discover and analyze and solve hidden problems. To enable the debugging mode, you only need to add a constant definition code in the entry file:
The code in my index. php is shared with you:
The Code is as follows: |
Copy code |
<? Php Require './ThinkPHP. php '; Define ('app _ debug', 1 ); ?> |
After the development phase is deployed to the production environment, you only need to delete the debugging mode and define the code to switch to the deployment mode.
After the debugging mode is enabled, the system first loads the default debugging configuration file of the system, and then adds the debugging configuration file for the purpose of the add-on. The debugging mode has the following advantages:
2. Enable Logging. All error information and debugging information are recorded in detail to facilitate debugging;
2. Disable template caching. template modifications can take effect immediately;
2. Record SQL logs to facilitate SQL analysis;
2. Disable field caching. Modifying data table fields is not affected by caching;
2. Check file case sensitivity (even on Windows) to help you detect Linux deployment problems in advance;
2.
It can be conveniently used in different stages of the development process, including development, testing, demonstration, and other situations. Different application modes can be used to configure independent project configuration files;
We will explain more about the debugging mode later.