In the admin panel of my project, I programmed the ability to change the database name to use. I wrote the new database name in the parameters.ini
, and after that the cache had to be cleaned to load the new config.
What is the best way to clean the cache without running the console command?
Or is there another best practise how to change the current db.
Although his answer is more/less obsolete, his recommendation is still useful today:
So following his recommendation I wrote a function that does exactly that:
where
delTree($dir_name)
could be any function that removes recursively a directory tree. Just check the PHPrmdir
function's User Contribution Notes, there are plenty of suggestions.