-
Notifications
You must be signed in to change notification settings - Fork 11
/
bow
executable file
·56 lines (45 loc) · 1.78 KB
/
bow
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
#!/usr/bin/env php
<?php
use App\Kernel;
use Bow\Console\Setting;
use Bow\Console\Console;
// Register The Auto Loader
if (!file_exists(__DIR__."/vendor/autoload.php")) {
die("Please install the depencencies with 'composer update'");
}
require __DIR__."/vendor/autoload.php";
// Make kernel instance
$kernel = Kernel::configure(__DIR__.'/config');
// Create command instance and set filename
$setting = new Setting(__DIR__);
$setting->setNamespaces($kernel->namespaces());
// Change preset destination
$setting->setModelDirectory(__DIR__.'/app/Models');
$setting->setValidationDirectory(__DIR__.'/app/Validations');
$setting->setPackageDirectory(__DIR__.'/app/Configurations');
$setting->setControllerDirectory(__DIR__.'/app/Controllers');
$setting->setMiddlewareDirectory(__DIR__.'/app/Middlewares');
$setting->setMigrationDirectory(__DIR__.'/migrations');
$setting->setExceptionDirectory(__DIR__.'/app/Exceptions');
$setting->setServiceDirectory(__DIR__.'/app/Services');
$setting->setEventDirectory(__DIR__.'/app/Events');
$setting->setEventListenerDirectory(__DIR__.'/app/Listeners');
$setting->setSeederDirectory(__DIR__.'/seeders');
$setting->setComponentDirectory(__DIR__.'/frontend');
$setting->setConfigDirectory(__DIR__.'/config');
$setting->setPublicDirectory(__DIR__.'/public');
$setting->setProducerDirectory(__DIR__.'/app/Producers');
$setting->setCommandDirectory(__DIR__.'/app/Commands');
// Defines the local server starter
$setting->setServerFilename(__DIR__.'/server.php');
$setting->setVarDirectory(__DIR__.'/var');
// Create console instance
$console = new Console($setting);
// Bind kernel to console
$console->bind($kernel);
// Load the custom command application
if (file_exists(__DIR__.'/routes/console.php')) {
require __DIR__.'/routes/console.php';
}
// Start console
$console->run();