/
sajan
executable file
·49 lines (45 loc) · 1.71 KB
/
sajan
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
#!/usr/bin/env php
<?php
use Dietercoopman\SajanPhp\DnsFlushCommand;
use Dietercoopman\SajanPhp\DnsUsingCommand;
use Dietercoopman\SajanPhp\IpLanCommand;
use Dietercoopman\SajanPhp\IpPublicCommand;
use Dietercoopman\SajanPhp\KeyMakeCommand;
use Dietercoopman\SajanPhp\KeyCopyCommand;
use Dietercoopman\SajanPhp\LaravelSitesCommand;
use Dietercoopman\SajanPhp\ServerDeleteCommand;
use Dietercoopman\SajanPhp\ServerCreateCommand;
use Dietercoopman\SajanPhp\ServerInfoCommand;
use Dietercoopman\SajanPhp\MiscSecretCommand;
use Dietercoopman\SajanPhp\SajanApplication;
use Dietercoopman\SajanPhp\ServerListCommand;
use Dietercoopman\SajanPhp\StarCommand;
use Dietercoopman\SajanPhp\TipsCommand;
use Dietercoopman\SajanPhp\UpdateCommand;
use Symfony\Component\Process\Process;
if (file_exists(__DIR__ . '/../../autoload.php')) {
require __DIR__ . '/../../autoload.php';
} else {
require __DIR__ . '/vendor/autoload.php';
}
/**
* Start the console application.
*/
$version = trim(array_values(array_filter(explode(' ', Process::fromShellCommandline('composer global info | grep sajan')->mustRun()->getOutput())))[1]);
$app = new SajanApplication('<fg=green>Sajan</> version', $version, get_defined_vars()['argv']);
$app->add(new DnsFlushCommand());
$app->add(new DnsUsingCommand());
$app->add(new IpLanCommand());
$app->add(new IpPublicCommand());
$app->add(new KeyMakeCommand());
$app->add(new KeyCopyCommand());
$app->add(new ServerCreateCommand());
$app->add(new ServerInfoCommand());
$app->add(new ServerListCommand());
$app->add(new ServerDeleteCommand());
$app->add(new LaravelSitesCommand());
$app->add(new MiscSecretCommand());
$app->add(new StarCommand());
$app->add(new TipsCommand());
$app->add(new UpdateCommand());
$app->run();