-
Notifications
You must be signed in to change notification settings - Fork 20
/
esc
67 lines (61 loc) · 2.06 KB
/
esc
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
<?php
require 'vendor/autoload.php';
require 'core/global-functions.php';
use EvoSC\Commands\EscRunSignal;
use EvoSC\Commands\LoadAuthorNamesTMX;
use EvoSC\Commands\GetVersion;
use EvoSC\Commands\EscRun;
use EvoSC\Commands\AddAdmin;
use EvoSC\Commands\DeleteUnusedConfigs;
use EvoSC\Commands\FakeLocals;
use EvoSC\Commands\ImportUaseco;
use EvoSC\Commands\ImportPyplanet;
use EvoSC\Commands\MakeMigration;
use EvoSC\Commands\Migrate;
use EvoSC\Commands\SetupAccessRights;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
global $_isVerbose;
global $_isVeryVerbose;
global $_isDebug;
global $_skipMapCheck;
$_isVerbose = false;
$_isVeryVerbose = false;
$_isDebug = false;
$_skipMapCheck = false;
$input = new ArgvInput();
if ($input->hasParameterOption('-vvv', true) ||
$input->hasParameterOption('--verbose=3', true) ||
3 === $input->getParameterOption('--verbose', false, true)) {
$_isDebug = true;
$_isVerbose = true;
$_isVeryVerbose = true;
} elseif ($input->hasParameterOption('-vv', true) ||
$input->hasParameterOption('--verbose=2', true) ||
2 === $input->getParameterOption('--verbose', false, true)) {
$_isVeryVerbose = true;
$_isVerbose = true;
} elseif ($input->hasParameterOption('-v', true) ||
$input->hasParameterOption('--verbose=1', true) ||
$input->hasParameterOption('--verbose', true) ||
$input->getParameterOption('--verbose', false, true)) {
$_isVerbose = true;
}
$application = new Application();
$application->add(new Migrate());
$application->add(new MakeMigration());
$application->add(new ImportUaseco());
$application->add(new ImportPyplanet());
$application->add(new GetVersion());
$application->add(extension_loaded('pcntl') ? new EscRunSignal(): new EscRun());
$application->add(new FakeLocals());
$application->add(new AddAdmin());
$application->add(new SetupAccessRights());
$application->add(new LoadAuthorNamesTMX());
$application->add(new DeleteUnusedConfigs());
$application->setDefaultCommand("list");
try {
$application->run();
} catch (Exception $e) {
die($e);
}