-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhisper
70 lines (63 loc) · 1.8 KB
/
whisper
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env php
<?php
// Register the Composer autoloader...
require __DIR__ . "/vendor/autoload.php";
require __DIR__ . "/bootstrap/whisper.php";
use Abyss\Whisper\MakeController;
use Abyss\Whisper\MakeFactory;
use Abyss\Whisper\MakeMigration;
use Abyss\Whisper\MakeModel;
use Abyss\Whisper\MigrationRunner;
use Abyss\Whisper\SeedDatabase;
use Abyss\Whisper\Serve;
// Capture command-line arguments
$command = $argv[1] ?? null;
switch ($command) {
case "serve":
// Start the Abyss server
new Serve()->handle();
break;
case "migrate":
// Call the migration runner
new MigrationRunner()->run();
break;
case "seed":
// Call the migration runner
new SeedDatabase()->run();
break;
case "make:migration":
// * Create a migration
new MakeMigration($argv)->make();
break;
case "make:factory":
new MakeFactory($argv)->make();
break;
case "make:model":
new MakeModel($argv)->make();
break;
case "make:controller":
new MakeController($argv)->make();
break;
case "help":
echo "Available commands are:\n";
echo "serve\n";
echo "migrate\n";
echo "seed\n";
echo "make:migration {table_name}\n";
echo "make:factory {table_name}\n";
echo "make:model {table_name}\n";
echo "make:controller {table_name}\n";
break;
default:
echo "Unknown command: $command\n";
echo "Available commands are:\n";
echo "help\n";
echo "serve\n";
echo "migrate\n";
echo "seed\n";
echo "make:migration {table_name}\n";
echo "make:factory {table_name}\n";
echo "make:model {table_name}\n";
echo "make:controller {table_name}\n";
break;
}