Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Phpcms v9 method to turn off caching

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report