API Base App
This commit is contained in:
40
api/setup/setups/02_services.php
Normal file
40
api/setup/setups/02_services.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
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('emails')->folder,
|
||||
$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('attachments_folder')
|
||||
);
|
||||
},
|
||||
\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
|
||||
);
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user