forked from lavary/crunz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
crunz
executable file
·53 lines (42 loc) · 1.38 KB
/
crunz
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
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| Crunz
|--------------------------------------------------------------------------
|
| This file is part of Crunz library.
| (c) Reza M. Lavaryan <[email protected]>
| For the full copyright and license information, please view the LICENSE
| file that was distributed with this source code.
|
*/
foreach ([
__DIR__ . '/../autoload.php',
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php',
__DIR__ . '/../../vendor/autoload.php'
] as $file) {
if (file_exists($file)) {
define('AUTOLOAD_PHP_FILE', $file);
break;
}
}
if (!defined('AUTOLOAD_PHP_FILE')) {
fwrite(STDERR,
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
die(1);
}
require AUTOLOAD_PHP_FILE;
// Setting the base directory as an environment variable
setbase(
getroot(AUTOLOAD_PHP_FILE)
);
// Setting the handler for catching/logging fatal and parse errors.
Crunz\ErrorHandler::getInstance()->set();
$kernel = (new Crunz\Console\CommandKernel('Crunz Command Line Interface', 'v1.4.0'))
->handle();