#!/usr/bin/env php getFilename() !== '.gitkeep') { $file->isDir() ? rmdir($file) : unlink($file); } } } $action = isset($argv[1]) ? $argv[1] : 'all'; switch ($action) { case 'cache': cleanDir('resources/cache'); break; case 'sessions': cleanDir('resources/sessions'); break; case 'all': cleanDir('resources/cache'); cleanDir('resources/sessions'); break; case 'help': default: echo 'Usage: php ' . $argv[0] . ' ' . PHP_EOL; } exit(0);