Useful script for clear Symfony2 cache in production environnement where you can't use SSH access.
The script can't be execute by anybody.
For this there is two security controls in the script :
-
Control IP address In the script there is a PHP array named "$ips" where you have to add your IP address for access the script.
-
Control secret token When your IP address is enter in the "$ips" array your have to define a secret token "$okToken" Then when you access the script you have to enter your token
Simple! Just put this script in your "./web" directory of your Symfony2 project.
Access your script : "www.your-domain.com/web/delete-cache.php".
Don't forget the token : "www.your-domain.com/web/delete-cache.php?token=123".
- Control client IP address
- Control token
- Delete Symfony environnement cache directory
- Purge APC system cache
- Return result with logs