-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbootstrap.php
More file actions
30 lines (22 loc) · 734 Bytes
/
bootstrap.php
File metadata and controls
30 lines (22 loc) · 734 Bytes
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
<?php
// Initialize Silex App
$app = new Silex\Application();
// Get configuration
$app['config'] = require __DIR__ .'/config.php';
// Register providers
require __DIR__ .'/providers.php';
// Register plugins
require __DIR__ .'/plugins.php';
// Load custom scripts
if (file_exists($app['config']['app_dir'] .'/bootstrap.php')) {
require $app['config']['app_dir'] .'/bootstrap.php';
}
// Error page
$app->error(function (\Exception $e, $code) use ($app) {
if ($app['debug'] === false) {
$code = ($e instanceof Symfony\Component\HttpKernel\Exception\HttpException) ? $e->getStatusCode() : 500;
return $app['twig']->render('admin/error.twig', array('code' => $code));
}
});
// Return app
return $app;