phpdoc
[pharext/pharext.org] / public / index.php
1 <?php
2
3 namespace app;
4
5 try {
6 $bootstrap = require "../app/bootstrap.php";
7 /* @var $injector \auryn\Injector */
8 $injector = $bootstrap(["config", "github", "plates", "model", "web"]);
9 return $injector->execute(Web::class);
10 } catch (\Exception $e) {
11 $error = $e->getMessage();
12 $stack = $e->getTraceAsString();
13 @header("X-Exception: ".get_class($e), false, 500);
14 Web::cleanBuffers();
15 }
16 ?>
17 <html>
18 <head>
19 <meta charset="utf-8">
20 <title>Application Error</title>
21 <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
22 </head>
23 <body>
24 <div class="container">
25 <div class="jumbotron">
26 <h1>Application Error</h1>
27 <h2>Aww, you really gotta do that?!</h2>
28 <p class="text-danger">
29 <strong><?= htmlspecialchars($error) ?></strong>
30 </p>
31 <p>
32 Sorry, anyway.
33 </p>
34 </div>
35 <?php if (APP_ENVIRONMENT != "production") : ?>
36 <pre><?= htmlspecialchars($stack) ?></pre>
37 <?php endif; ?>
38 </div>
39 </body>
40 </html>