Permalink
Browse files

Added a web-based cache clearer

  • Loading branch information...
1 parent 737c43f commit 4bbbe13f4d6a90bdad1868d1519d5b9400554d6c @pascaldevink committed Apr 18, 2012
Showing with 22 additions and 2 deletions.
  1. +22 −2 web/clear-cache.php
View
@@ -1,4 +1,24 @@
<?php
-echo `php ../app/console env=prod cache:clear`;
-echo `php ../app/console env=prod cache:warm`;
+//just for see if there are errors
+error_reporting(E_ALL);
+ini_set('display_errors', '1');
+
+//erases a directory recursively
+function rrmdir($dir) {
+ if (is_dir($dir)) {
+ $objects = scandir($dir);
+ foreach ($objects as $object) {
+ if ($object != "." && $object != "..") {
+ if (filetype($dir . "/" . $object) == "dir")
+ rrmdir($dir . "/" . $object); else
+ unlink($dir . "/" . $object);
+ }
+ }
+
+ reset($objects);
+ rmdir($dir);
+ }
+}
+//erases the cache
+rrmdir('../app/cache/');

0 comments on commit 4bbbe13

Please sign in to comment.