65c1b5fb75
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
29 lines
640 B
PHP
Executable File
29 lines
640 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
/**
|
|
* Console Entry Point
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
use KTXC\Application;
|
|
|
|
if (!is_dir(dirname(__DIR__).'/vendor')) {
|
|
fwrite(STDERR, "Dependencies are missing. Run 'composer install' first.\n");
|
|
exit(1);
|
|
}
|
|
|
|
$composerLoader = require_once dirname(__DIR__).'/vendor/autoload.php';
|
|
|
|
try {
|
|
$application = Application::create(dirname(__DIR__), $composerLoader);
|
|
exit($application->runConsole());
|
|
} catch (\Throwable $e) {
|
|
fwrite(STDERR, "Fatal error: {$e->getMessage()}\n");
|
|
if (($application ?? null)?->debug()) {
|
|
fwrite(STDERR, $e->getTraceAsString()."\n");
|
|
}
|
|
exit(1);
|
|
}
|