2018-04-28 12:20:07 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
2022-06-19 21:29:59 +00:00
|
|
|
((PHP_MAJOR_VERSION >= 7 && PHP_MINOR_VERSION >= 3) || PHP_MAJOR_VERSION > 7) ?: die('Sorry, PHP 7.3 or above is required to run XBackBone.');
|
2021-07-31 11:09:45 +00:00
|
|
|
if (PHP_SAPI !== 'cli') {
|
2018-04-28 12:20:07 +00:00
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
2019-09-03 19:53:12 +00:00
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
|
2018-04-28 12:20:07 +00:00
|
|
|
$action = isset($argv[1]) ? $argv[1] : 'all';
|
|
|
|
|
|
|
|
switch ($action) {
|
|
|
|
case 'cache':
|
2018-11-13 17:05:17 +00:00
|
|
|
cleanDirectory(__DIR__ . '/../resources/cache');
|
2018-04-28 12:20:07 +00:00
|
|
|
break;
|
|
|
|
case 'sessions':
|
2018-11-13 17:05:17 +00:00
|
|
|
cleanDirectory(__DIR__ . '/../resources/sessions');
|
2018-04-28 12:20:07 +00:00
|
|
|
break;
|
|
|
|
case 'all':
|
2018-11-13 17:05:17 +00:00
|
|
|
cleanDirectory(__DIR__ . '/../resources/cache');
|
|
|
|
cleanDirectory(__DIR__ . '/../resources/sessions');
|
2018-04-28 12:20:07 +00:00
|
|
|
break;
|
|
|
|
case 'help':
|
|
|
|
default:
|
|
|
|
echo 'Usage: php ' . $argv[0] . ' <cache|sessions|all|help>' . PHP_EOL;
|
|
|
|
}
|
|
|
|
|
|
|
|
exit(0);
|