In my WBlog, a cache cleanup worker can delete cache files generated when the program is running. All these files are stored in the Runtime folder of the project. At that time, when I used a function customized by the project function library to delete the cached files, I could only delete the entire Runtime, which was too rough. I think it is necessary to perform a further deletion. In fact, the thinkphp extension class library has a good file processing class Dir. class. php. Dir. class. not every thinkp of the php class can be cleared in my WBlog. Clearing the cache is to delete the cache files generated when the program is running, all these files are stored in the Runtime folder of the project. At that time, when I used a function customized by the project function library to delete the cached files, I could only delete the entire Runtime, which was too rough. I think it is necessary to perform a further deletion. In fact, the thinkphp extension class library has a good file processing class Dir. class. php. The Dir. class. php class is not available in every thinkphp version. if the version you downloaded does not exist, you can find it from other versions. Now let's talk about the application of Dir. class. php.
Dir. class. php is a file processing class. You can use it:
1. Get the file information under the Directory
2. delete a directory or file
As I want to improve the WBlog cache clearing function, I only write the above 2nd functions. As for the 1st functions, I will write the template text modification function again. The following is a del () method defined by the Controller that is clearing the cache:
Public function del () {$ type = trim ($