(1) thinkphp has a configuration file config. php. We only need to add the following two sentences to the file:
| The code is as follows: |
Copy code |
'Tmpl _ CACHE_ON '=> false, // disable Template compilation cache 'HTML _ CACHE_ON '=> false, // disable static cache |
(2) disable all caches in the entry file
Add the following code to the entry file:
| The code is as follows: |
Copy code |
Define ('app _ debug', TRUE); // enable debugging mode Define ('Db _ FIELD_CACHE ', false ); Define ('HTML _ CACHE_ON ', false); // www.111cn.net |
(3) modify the default value of the program
1. Find the ThinkPHPCommonconvention. php and ThinkPHPCommondebug. php files.
2. Open these two files and modify them as follows:
Convention. Php file:
| The code is as follows: |
Copy code |
'Tmpl _ CACHE_ON '=> false, // If template compilation cache is enabled by default, the template is re-compiled every time. 'Action _ CACHE_ON '=> false, // ACTION cache is disabled by default. 'HTML _ CACHE_ON '=> false, // The static cache is disabled by default. |
Debug. Php file:
| The code is as follows: |
Copy code |
'Tmpl _ CACHE_ON '=> false, // The template cache is enabled by default. |
In this way, you can use thinkphp without caching during testing. Of course, it is better if you want to enable caching on the server.