-
Notifications
You must be signed in to change notification settings - Fork 0
/
haku
55 lines (43 loc) · 1.15 KB
/
haku
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
#!/usr/bin/env php
<?php
declare(strict_types=1);
namespace Haku;
error_reporting(E_ALL & ~E_NOTICE);
define('HAKU_ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
define('HAKU_PHP_VERSION', '8.3.0');
if (version_compare(PHP_VERSION, HAKU_PHP_VERSION, '<')) {
echo sprintf("Haku requires PHP %s, version %s installed.", HAKU_PHP_VERSION, PHP_VERSION);
exit;
}
$didThrow = false;
try
{
require_once implode(DIRECTORY_SEPARATOR, [
rtrim(HAKU_ROOT_PATH, DIRECTORY_SEPARATOR),
'vendor', 'Haku', 'bootstrap.php'
]);
autoloadResolver();
$engine = new Console\Engine();
$engine->registerCommand(new Console\Commands\Init());
$engine->registerCommand(new Console\Commands\Version());
$engine->registerCommand(new Console\Commands\Upgrade());
$engine->registerCommand(new Console\Commands\Serve());
$engine->registerCommand(new Console\Commands\Routes());
$engine->registerCommand(new Console\Commands\Test());
$engine->registerCommand(new Console\Commands\Make());
$engine->registerCommand(new Console\Commands\Rand());
$engine->run();
}
catch(\Throwable $throwable)
{
print_r($throwable);
$didThrow = true;
}
finally
{
if ($didThrow)
{
exit -1;
}
exit;
}