Initial commit
This commit is contained in:
24
src/entry.php
Normal file
24
src/entry.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__."/../vendor/autoload.php";
|
||||
|
||||
$filename = $argv[1]??null; // ?(__DIR__."/../composer.json");
|
||||
|
||||
$terminal = new NoccyLabs\JEdit\Terminal\Terminal();
|
||||
|
||||
$editor = new NoccyLabs\JEdit\Editor\Editor($terminal);
|
||||
if ($filename) {
|
||||
$editor->loadFile($filename);
|
||||
} else {
|
||||
$editor->loadDocument((object)[]);
|
||||
}
|
||||
|
||||
|
||||
set_exception_handler(function (\Throwable $t) use ($terminal) {
|
||||
register_shutdown_function(function () use ($t, $terminal) {
|
||||
$terminal->shutdown();
|
||||
echo $t."\n";
|
||||
});
|
||||
});
|
||||
|
||||
$editor->run();
|
||||
Reference in New Issue
Block a user