aboutsummaryrefslogtreecommitdiff
path: root/lib/bootstrap-definitions.php
blob: ee80135be09cabd42e8dded7cfb1d982fe53b4d7 (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
            ),
        ]);
    }),
    \Studip\Cache\Cache::class => DI\factory(function () {
        return \Studip\Cache\Factory::getCache();
    }),
    StudipPDO::class => DI\factory(function () {
        return DBManager::get();
    }),
    Trails_Dispatcher::class => DI\factory(function (ContainerInterface $container) {
        return new \StudipDispatcher($container);
    }),
];