szurubooru/src/di.php

20 lines
717 B
PHP
Raw Normal View History

2014-08-30 15:04:33 +02:00
<?php
$dataDirectory = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data';
2014-08-30 15:04:33 +02:00
return [
\Szurubooru\Config::class => DI\object()->constructor([
$dataDirectory . DIRECTORY_SEPARATOR . 'config.ini',
$dataDirectory . DIRECTORY_SEPARATOR . 'local.ini']),
\Szurubooru\Services\FileService::class => DI\object()->constructor($dataDirectory),
2014-08-31 13:34:31 +02:00
\Szurubooru\ControllerRepository::class => DI\object()->constructor(DI\link('controllers')),
'controllers' => DI\factory(function (DI\container $c) {
return [
$c->get(\Szurubooru\Controllers\AuthController::class),
$c->get(\Szurubooru\Controllers\UserController::class),
$c->get(\Szurubooru\Controllers\UserAvatarController::class),
2014-08-31 13:34:31 +02:00
];
}),
2014-08-30 15:04:33 +02:00
];