szurubooru/src/di.php

73 lines
3.5 KiB
PHP
Raw Normal View History

2014-08-30 15:04:33 +02:00
<?php
$dataDirectory = __DIR__
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'data';
$publicDataDirectory = __DIR__
. DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . 'public_html'
. DIRECTORY_SEPARATOR . 'data';
2014-09-09 12:34:57 +02:00
2014-08-30 15:04:33 +02:00
return [
\Szurubooru\Config::class => DI\object()->constructor($dataDirectory, $publicDataDirectory),
2014-08-31 13:34:31 +02:00
\Szurubooru\ControllerRepository::class => DI\object()->constructor(DI\link('controllers')),
2014-09-14 16:16:15 +02:00
\Szurubooru\Upgrades\UpgradeRepository::class => DI\object()->constructor(DI\link('upgrades')),
'upgrades' => DI\factory(function (DI\container $container) {
return [
$container->get(\Szurubooru\Upgrades\Upgrade00::class),
2014-09-14 16:16:15 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade01::class),
$container->get(\Szurubooru\Upgrades\Upgrade02::class),
2014-09-15 11:38:24 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade03::class),
2014-09-18 19:30:12 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade04::class),
2014-09-21 09:35:43 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade05::class),
$container->get(\Szurubooru\Upgrades\Upgrade06::class),
2014-09-24 23:24:51 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade07::class),
2014-09-25 23:53:47 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade08::class),
2014-09-26 20:41:28 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade09::class),
2014-09-27 21:33:31 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade10::class),
2014-09-28 15:21:25 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade11::class),
$container->get(\Szurubooru\Upgrades\Upgrade12::class),
2014-10-04 12:02:58 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade13::class),
2014-10-04 12:06:50 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade14::class),
$container->get(\Szurubooru\Upgrades\Upgrade15::class),
2014-10-05 16:19:08 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade16::class),
2014-10-05 22:26:56 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade17::class),
2014-10-06 21:16:11 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade18::class),
2014-10-09 09:45:06 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade19::class),
2014-10-11 19:37:19 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade20::class),
2014-10-10 19:46:33 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade21::class),
2014-10-12 12:44:21 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade22::class),
2014-10-14 22:56:15 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade23::class),
2014-10-15 16:00:03 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade24::class),
2014-10-19 13:05:21 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade25::class),
$container->get(\Szurubooru\Upgrades\Upgrade26::class),
2014-10-25 12:27:04 +02:00
$container->get(\Szurubooru\Upgrades\Upgrade27::class),
$container->get(\Szurubooru\Upgrades\Upgrade28::class),
2014-11-07 13:43:07 +01:00
$container->get(\Szurubooru\Upgrades\Upgrade29::class),
2014-11-09 14:04:44 +01:00
$container->get(\Szurubooru\Upgrades\Upgrade30::class),
2014-11-09 16:01:02 +01:00
$container->get(\Szurubooru\Upgrades\Upgrade31::class),
2014-11-09 16:12:36 +01:00
$container->get(\Szurubooru\Upgrades\Upgrade32::class),
2014-11-09 17:04:04 +01:00
$container->get(\Szurubooru\Upgrades\Upgrade33::class),
2014-09-14 16:16:15 +02:00
];
}),
2014-08-31 13:34:31 +02:00
2014-09-09 12:34:57 +02:00
'controllers' => DI\factory(function (DI\container $container) {
2014-08-31 13:34:31 +02:00
return [
2014-09-09 12:34:57 +02:00
$container->get(\Szurubooru\Controllers\AuthController::class),
$container->get(\Szurubooru\Controllers\UserController::class),
$container->get(\Szurubooru\Controllers\UserAvatarController::class),
2014-09-15 11:38:24 +02:00
$container->get(\Szurubooru\Controllers\PostController::class),
$container->get(\Szurubooru\Controllers\PostContentController::class),
2014-10-25 23:04:43 +02:00
$container->get(\Szurubooru\Controllers\PostNotesController::class),
2014-09-25 11:45:46 +02:00
$container->get(\Szurubooru\Controllers\GlobalParamController::class),
2014-09-26 20:41:28 +02:00
$container->get(\Szurubooru\Controllers\HistoryController::class),
2014-09-27 21:33:31 +02:00
$container->get(\Szurubooru\Controllers\FavoritesController::class),
$container->get(\Szurubooru\Controllers\ScoreController::class),
2014-10-04 13:56:38 +02:00
$container->get(\Szurubooru\Controllers\CommentController::class),
2014-10-06 21:16:59 +02:00
$container->get(\Szurubooru\Controllers\TagController::class),
2014-08-31 13:34:31 +02:00
];
}),
2014-08-30 15:04:33 +02:00
];