Phpcms v9 method to turn off caching
How does phpcms v9 turn off caching? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
How does phpcms v9 turn off caching
Remove the template cache of phpcms
Recently, I have been using phpcms to do a simple thing. Because it is too simple, I debugged it directly on ftp, but uploaded the template file, but the foreground did not refresh it. I went to the cache directory to delete the generated cache php. I felt annoyed to operate it back and forth several times, but I didn't find a suitable article on the Internet to turn it off, so simply and crudely, I killed the cache first.
There is a function in global.func.php named
Function template ($module = 'content', $template =' index', $style ='') if (file_exists (PC_PATH. 'templates'. DIRECTORY_SEPARATOR. $style. DIRECTORY_SEPARATOR. $module. DIRECTORY_SEPARATOR. $template. ) {if (! file_exists ($compiledtplfile) | (@ filemtime (PC_PATH.)). 'templates'. DIRECTORY_SEPARATOR. $style. DIRECTORY_SEPARATOR. $module. DIRECTORY_SEPARATOR. $template. '.html') > @ filemtime ($compiledtplfile)) {$template_cache- > template_compile ($module, $template, $style);}}
Just get rid of the if inside, how simple and rude it is, so that you can compile it every time, but you don't have to worry too much about a simple small project.
If (file_exists (PC_PATH. 'templates'. DIRECTORY_SEPARATOR. $style. DIRECTORY_SEPARATOR. $module. DIRECTORY_SEPARATOR. $template. '.html') {/ / if (! file_exists ($compiledtplfile) | @ filemtime (PC_PATH. 'templates'. DIRECTORY_SEPARATOR. $style. DIRECTORY_SEPARATOR. $module. DIRECTORY_SEPARATOR. $template. '.html') > @ filemtime ($compiledtplfile)) / / {$template_cache- > template_compile ($module, $template, $style); / /} Thank you for reading! After reading the above, do you have a general idea of how phpcms v9 closes the cache? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.