-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fast-mvc
31 lines (26 loc) · 799 Bytes
/
fast-mvc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
if(php_sapi_name() !== 'cli') {
echo 'Command line only' . PHP_EOL;
}
$availableCommands = [
'cache:clear' => 'Clear all application cache',
'cache:clear pdo' => 'Clear pdo cache',
'cache:clear custom' => 'Clear custom cache',
'cache:clear fast-route' => 'Clear fast route cache',
];
if(!isset($argv[1])) {
echo 'Please enter a command' . PHP_EOL;
return;
}
switch($argv[1]) {
case 'cache:clear':
include 'core/cli/clear-cache.php';
clearCache(isset($argv[2]) ? $argv[2] : null);
break;
default:
echo PHP_EOL . 'Available commands:' . PHP_EOL . PHP_EOL;
foreach($availableCommands as $command => $description) {
echo "php fast-mvc {$command} - {$description}" . PHP_EOL;
}
echo PHP_EOL;
}