-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmgine
35 lines (26 loc) · 865 Bytes
/
mgine
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
#!/usr/bin/env php
<?php
$scriptDir = dirname($_SERVER['SCRIPT_FILENAME']);
$vendorDir = realpath($scriptDir . '/..');
$appRootPath = realpath($vendorDir . '/..');
$autoload = $vendorDir . '/autoload.php';
if(file_exists($autoload)){
require $autoload;
}
if (!isset($vendorDir)) {
echo "composer autoloader could not be found.\nYou should run `composer install` in repo root directory.\n";
exit(1);
}
$application = new mgine\console\Application([
'basePath' => $scriptDir,
'controllerNamespace' => 'mgine\builder\controllers',
'defaultRoute' => 'help',
'commandsList' => \mgine\builder\controllers\HelpController::$commandsList,
'params' => [
'vendorDir' => $vendorDir,
'appRootPath' => $appRootPath,
]
]);
$version = '0.0.1';
print "M-Gine commands ($version)" . PHP_EOL . PHP_EOL;
$application->run();