-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmil.php
More file actions
49 lines (38 loc) · 931 Bytes
/
Copy pathmil.php
File metadata and controls
49 lines (38 loc) · 931 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
use Core\Commands\Command;
if (php_sapi_name() !== 'cli') {
exit("This script can only be run from the command line.\n");
}
require_once __DIR__ . '/index.php';
Command::cyan("\nWelcome to the PHP MVC framework CLI!\n\n");
$commands = [
'migration:create',
'migration:run',
'migration:rollback',
'migration:refresh',
];
echo "Available commands:\n";
foreach ($commands as $index => $command) {
echo " $index) ";
Command::green($command);
echo "\n";
}
echo "\n";
$command = readline("Enter a command: ");
switch ($command) {
case 0:
\Core\Commands\Migration::create();
break;
case 1:
\Core\Commands\Migration::run();
break;
case 2:
\Core\Commands\Migration::rollback();
break;
case 3:
\Core\Commands\Migration::refresh();
break;
default:
Command::red("Invalid command.");
exit();
}