2024-01-12 08:22:17 +01:00
|
|
|
<?php
|
|
|
|
|
2024-02-08 12:23:56 +01:00
|
|
|
use PandoraFMS\Modules\Authentication\Repositories\TokenRepository;
|
|
|
|
use PandoraFMS\Modules\Authentication\Repositories\TokenRepositoryMySQL;
|
2024-01-29 16:09:08 +01:00
|
|
|
use PandoraFMS\Modules\Events\Repositories\EventRepository;
|
|
|
|
use PandoraFMS\Modules\Events\Repositories\EventRepositoryMySQL;
|
2024-01-30 16:27:02 +01:00
|
|
|
use PandoraFMS\Modules\Groups\Repositories\GroupRepository;
|
|
|
|
use PandoraFMS\Modules\Groups\Repositories\GroupRepositoryMySQL;
|
2024-03-19 19:21:54 +01:00
|
|
|
use PandoraFMS\Modules\PandoraITSM\Inventories\Repositories\PandoraITSMInventoryRepository;
|
|
|
|
use PandoraFMS\Modules\PandoraITSM\Inventories\Repositories\PandoraITSMInventoryRepositoryMySQL;
|
2024-01-12 08:22:17 +01:00
|
|
|
use PandoraFMS\Modules\Shared\Repositories\Repository;
|
|
|
|
use PandoraFMS\Modules\Shared\Repositories\RepositoryMySQL;
|
|
|
|
use PandoraFMS\Modules\Users\Repositories\UserRepository;
|
|
|
|
use PandoraFMS\Modules\Users\Repositories\UserRepositoryMySQL;
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
use Slim\App;
|
|
|
|
use Slim\Factory\AppFactory;
|
|
|
|
|
|
|
|
return [
|
2024-03-19 19:21:54 +01:00
|
|
|
'settings' => function () {
|
2024-01-12 08:22:17 +01:00
|
|
|
return include __DIR__.'/settings.php';
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
App::class => function (ContainerInterface $container) {
|
2024-01-12 08:22:17 +01:00
|
|
|
AppFactory::setContainer($container);
|
|
|
|
|
|
|
|
$app = AppFactory::create();
|
|
|
|
|
|
|
|
$basePath = rtrim(
|
|
|
|
preg_replace(
|
|
|
|
'/(.*)public\/.*/',
|
|
|
|
'$1',
|
|
|
|
$_SERVER['SCRIPT_NAME']
|
|
|
|
),
|
|
|
|
'/'
|
|
|
|
);
|
|
|
|
|
|
|
|
$app->setBasePath($basePath);
|
|
|
|
|
|
|
|
// Register middleware.
|
|
|
|
(include __DIR__.'/middleware.php')($app, $container);
|
|
|
|
|
|
|
|
return $app;
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
Repository::class => function (ContainerInterface $container) {
|
2024-01-12 08:22:17 +01:00
|
|
|
return $container->get(RepositoryMySQL::class);
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
TokenRepository::class => function (ContainerInterface $container) {
|
2024-02-08 12:23:56 +01:00
|
|
|
return $container->get(TokenRepositoryMySQL::class);
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
UserRepository::class => function (ContainerInterface $container) {
|
2024-01-12 08:22:17 +01:00
|
|
|
return $container->get(UserRepositoryMySQL::class);
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
GroupRepository::class => function (ContainerInterface $container) {
|
2024-01-30 16:27:02 +01:00
|
|
|
return $container->get(GroupRepositoryMySQL::class);
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
EventRepository::class => function (ContainerInterface $container) {
|
2024-01-29 16:09:08 +01:00
|
|
|
return $container->get(EventRepositoryMySQL::class);
|
|
|
|
},
|
2024-03-19 19:21:54 +01:00
|
|
|
PandoraITSMInventoryRepository::class => function (ContainerInterface $container) {
|
|
|
|
return $container->get(PandoraITSMInventoryRepositoryMySQL::class);
|
|
|
|
},
|
2024-01-12 08:22:17 +01:00
|
|
|
];
|