-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli
executable file
·33 lines (28 loc) · 938 Bytes
/
cli
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
#!/usr/bin/env php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Console\Application;
use linways\cli\command\db\CreateMigrationCommand;
use linways\cli\command\db\MigrateCommand;
use linways\cli\command\db\MigrateFakeCommand;
use linways\cli\command\tenant\InitCommand;
use Symfony\Component\Dotenv\Dotenv;
error_reporting(E_ALL ^ E_NOTICE);
$app = new Application('Linways CLI', 'v0.1');
$dotenv = new Dotenv();
try{
$dotenv->load('.cli.env');
}catch(\Exception $e){
error_log('No .cli.env file found. Loading default values');
}
if(empty(getenv("PHINX_CONF"))){
if(Phar::running(true))
putenv("PHINX_CONF=" . dirname(Phar::running(false)) . '/phinx.yml');
else
putenv("PHINX_CONF=" . __DIR__ . '/phinx.yml');
}
$app->add(new CreateMigrationCommand());
$app->add(new MigrateCommand());
$app->add(new MigrateFakeCommand());
$app->add(new InitCommand());
$app->run();