-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbootstrap.php
More file actions
36 lines (24 loc) · 799 Bytes
/
bootstrap.php
File metadata and controls
36 lines (24 loc) · 799 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
31
32
33
34
35
36
<?php
require __DIR__ . '/vendor/autoload.php';
$app = new \Slim\App;
$container = $app->getContainer();
$container['debug'] = false;
$container['displayErrorDetails'] = false;
if (file_exists(__DIR__ . '/config.php')) {
$config = include __DIR__ . '/config.php';
}
$container['deref.config'] = is_array($config) ? $config : [];
$container['logger'] = function ($c) {
$logger = new \Monolog\Logger('my_logger');
$file_handler = new \Monolog\Handler\StreamHandler(__DIR__ . '/logs/app.log');
$logger->pushHandler($file_handler);
return $logger;
};
// Deref application service
$container['deref'] = function ($c) {
$deref = new \Deref\Deref();
$logger = $c['logger'];
$deref->setLogger($logger);
return $deref;
};
return $app;