Full implemantation
This commit is contained in:
@ -1,2 +1,2 @@
|
||||
<?php
|
||||
$app->add($app->getContainer()->get(\ProVM\Common\Middleware\CORS::class));
|
||||
$app->add($app->getContainer()->get(ProVM\Common\Middleware\CORS::class));
|
||||
|
2
api/setup/middleware/03_custom_exceptions.php
Normal file
2
api/setup/middleware/03_custom_exceptions.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?php
|
||||
$app->add($app->getContainer()->get(ProVM\Common\Middleware\CustomExceptions::class));
|
@ -1,2 +1,2 @@
|
||||
<?php
|
||||
$app->add($app->getContainer()->get(\ProVM\Common\Middleware\Auth::class));
|
||||
$app->add($app->getContainer()->get(ProVM\Common\Middleware\Auth::class));
|
||||
|
@ -1,2 +1,2 @@
|
||||
<?php
|
||||
$app->add($app->getContainer()->get(\Zeuxisoo\Whoops\Slim\WhoopsMiddleware::class));
|
||||
$app->add($app->getContainer()->get(Zeuxisoo\Whoops\Slim\WhoopsMiddleware::class));
|
||||
|
@ -2,40 +2,21 @@
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
\ProVM\Common\Service\Mailboxes::class => function(ContainerInterface $container) {
|
||||
return (new \ProVM\Common\Service\Mailboxes(
|
||||
$container->get(\Ddeboer\Imap\ConnectionInterface::class),
|
||||
$container->get(\ProVM\Common\Service\Attachments::class),
|
||||
$container->get('emails')->username
|
||||
))->setLogger($container->get(\Psr\Log\LoggerInterface::class));
|
||||
},
|
||||
\ProVM\Common\Service\Emails::class => function(ContainerInterface $container) {
|
||||
return (new \ProVM\Common\Service\Emails(
|
||||
$container->get(\ProVM\Common\Service\Mailboxes::class),
|
||||
$container->get(\ProVM\Emails\Repository\Message::class),
|
||||
$container->get('attachments_folder')
|
||||
))->setLogger($container->get(\Psr\Log\LoggerInterface::class));
|
||||
},
|
||||
\ProVM\Common\Service\Attachments::class => function(ContainerInterface $container) {
|
||||
return new \ProVM\Common\Service\Attachments(
|
||||
$container->get(\ProVM\Common\Service\Decrypt::class),
|
||||
$container->get(\ProVM\Emails\Repository\Attachment::class),
|
||||
$container->get('attachments_folder')
|
||||
);
|
||||
},
|
||||
\ProVM\Common\Service\Decrypt::class => function(ContainerInterface $container) {
|
||||
return new \ProVM\Common\Service\Decrypt(
|
||||
$container->get(\Psr\Log\LoggerInterface::class),
|
||||
ProVM\Common\Service\Decrypt::class => function(ContainerInterface $container) {
|
||||
return new ProVM\Common\Service\Decrypt(
|
||||
$container->get(Psr\Log\LoggerInterface::class),
|
||||
$container->get('base_command'),
|
||||
$container->get('passwords')
|
||||
);
|
||||
},
|
||||
\ProVM\Common\Service\Install::class => function(ContainerInterface $container) {
|
||||
$database = $container->get('database');
|
||||
$pdo = new PDO("mysql:host={$database->host};dbname={$database->name}", $database->username, $database->password);
|
||||
return new \ProVM\Common\Service\Install(
|
||||
$container->get(\Psr\Log\LoggerInterface::class),
|
||||
$pdo
|
||||
ProVM\Common\Service\Attachments::class => function(ContainerInterface $container) {
|
||||
return new ProVM\Common\Service\Attachments(
|
||||
$container->get(ProVM\Common\Service\Messages::class),
|
||||
$container->get(ProVM\Emails\Repository\Attachment::class),
|
||||
$container->get(ProVM\Common\Service\Remote\Attachments::class),
|
||||
$container->get(ProVM\Common\Service\Decrypt::class),
|
||||
$container->get('attachments_folder'),
|
||||
$container->get(Psr\Log\LoggerInterface::class)
|
||||
);
|
||||
}
|
||||
];
|
||||
|
11
api/setup/setups/04_middlewares.php
Normal file
11
api/setup/setups/04_middlewares.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
ProVM\Common\Middleware\CustomExceptions::class => function(ContainerInterface $container) {
|
||||
return new ProVM\Common\Middleware\CustomExceptions(
|
||||
$container->get(Nyholm\Psr7\Factory\Psr17Factory::class),
|
||||
$container->get(Psr\Log\LoggerInterface::class)
|
||||
);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user