generated from librarianphp/librarian
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibrarian
executable file
·46 lines (38 loc) · 1.27 KB
/
librarian
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
#!/usr/bin/env php
<?php
if (php_sapi_name() !== 'cli') {
exit;
}
require __DIR__ . '/vendor/autoload.php';
use Librarian\Builder\StaticBuilder;
use Librarian\Provider\LibrarianServiceProvider;
use Librarian\Provider\RouterServiceProvider;
use Librarian\Provider\TwigServiceProvider;
use Minicli\App;
use Librarian\Provider\ContentServiceProvider;
use Minicli\Exception\CommandNotFoundException;
$app = new App();
$app->setSignature('
_ ____ ____ ____ ____ ____ ____ ____ ____
| | | || \ | \ / || \ | | / || \
| | | | | o )| D )| o || D ) | | | o || _ |
| |___ | | | || / | || / | | | || | |
| | | | | O || \ | _ || \ | | | _ || | |
| | | | | || . \| | || . \ | | | | || | |
|_____||____||_____||__|\_||__|__||__|\_||____||__|__||__|__|
Type "./librarian help" for help with available commands.
');
$app->librarian->boot();
try {
$app->runCommand($argv);
} catch (CommandNotFoundException $notFoundException) {
$app->error("Command Not Found.");
return 1;
} catch (Exception $exception) {
if ($app->config->debug) {
$app->error("An error occurred:");
$app->error($exception->getMessage());
}
return 1;
}
return 0;