aboutsummaryrefslogtreecommitdiff
path: root/lib/bootstrap-definitions.php
blob: 17f35d16d6478b302201cedd06c7d08eebbc0241 (plain)
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
<?php

use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

return [
    LoggerInterface::class => DI\factory(function () {
        return new Logger('studip', [
            new StreamHandler(
                $GLOBALS['TMP_PATH'] . '/studip.log',
                \Studip\ENV === 'development' ? Logger::DEBUG : Logger::ERROR
            ),
        ]);
    }),
    StudipCache::class => DI\factory(function () {
        return StudipCacheFactory::getCache();
    }),
    StudipPDO::class => DI\factory(function () {
        return DBManager::get();
    }),
    Trails_Dispatcher::class => DI\factory(function (ContainerInterface $container) {
        return new \StudipDispatcher($container);
    }),
];