diff --git a/bin/clear-cache b/bin/clear-cache new file mode 100755 index 0000000000..8d4f8b85ad --- /dev/null +++ b/bin/clear-cache @@ -0,0 +1,33 @@ +#!/usr/bin/env php + 1) { + $cacheDir .= '/' . $argv[1]; + if (!is_dir($cacheDir) || !is_writable($cacheDir)) { + die (sprintf("Environment cache directory '%s' does not seem to exist or is not writable to the current user.\n", $cacheDir)); + } +} + +if ('/' === DIRECTORY_SEPARATOR) { + system('rm -rf '.escapeshellarg($cacheDir)); +} else { + system('rmdir /S /Q '.escapeshellarg($cacheDir)); +} + +die (sprintf("Cache directory '%s' successfully removed.\n", $cacheDir));