Since 1.22.0
version of Twig
, method Twig_Environment::clearCacheFiles()
is deprecated. However, I didn't found anywhere (nor in documentation, nor in repo tickets, nor here on SO) something which can replace this deprecated method.
So what is the idiomatic (and not deprecated) way to clear all cache files now?
Clearing those files via implementing own function seems to be pretty weird.
So there is no new idiomatic way to clear all cache files.Twig
project maintainers leave it for library users on their own. The arguments are:
The argument was that Twig itself will only support filesystem cache (due to opcache). Thus clear() would be the same as removing the cache folder manually. Thus it doesn't need to be in the interface. So you have to clear your cache either manually or write the method yourself.
More details may be read in relevant issue early referred by @alain-tiemblo in comments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With