1 changed files with 0 additions and 55 deletions
@ -1,55 +0,0 @@
|
||||
<?php |
||||
|
||||
use App\Framework\Twig\UrlExtension; |
||||
use Framework\Middleware\CsrfMiddleware; |
||||
use Framework\Renderer\RendererInterface; |
||||
use Framework\Renderer\TwigRendererFactory; |
||||
use Framework\Router; |
||||
use Framework\Router\RouterFactory; |
||||
use Framework\Router\RouterTwigExtension; |
||||
use Framework\Session\PHPSession; |
||||
use Framework\Session\SessionInterface; |
||||
use Framework\Twig\{ |
||||
CsrfExtension, FlashExtension, FormExtension, PagerFantaExtension, TextExtension, TimeExtension |
||||
}; |
||||
include 'conf.php'; |
||||
return [ |
||||
'env' => \DI\env('ENV', 'production'), |
||||
/*'env' => \DI\env('ENV', 'development'),*/ |
||||
'database.host' => $host, |
||||
//'database.username' => 'guser', |
||||
'database.username' => $username, |
||||
//'database.password' => 'kptgT81U7nzYWHBdQ9', |
||||
'database.password' => $password, |
||||
'database.name' => $database_name, |
||||
'views.path' => dirname(__DIR__) . '/views', |
||||
'twig.extensions' => [ |
||||
\DI\get(RouterTwigExtension::class), |
||||
\DI\get(PagerFantaExtension::class), |
||||
\DI\get(TextExtension::class), |
||||
\DI\get(TimeExtension::class), |
||||
\DI\get(FlashExtension::class), |
||||
\DI\get(FormExtension::class), |
||||
\DI\get(CsrfExtension::class), |
||||
\DI\get(UrlExtension::class) |
||||
], |
||||
SessionInterface::class => \DI\object(PHPSession::class), |
||||
CsrfMiddleware::class => \DI\object()->constructor(\DI\get(SessionInterface::class)), |
||||
Router::class => \DI\factory(RouterFactory::class), |
||||
RendererInterface::class => \DI\factory(TwigRendererFactory::class), |
||||
\PDO::class => function (\Psr\Container\ContainerInterface $c) { |
||||
return new PDO( |
||||
'mysql:host='. $c->get('database.host') . ';dbname=' . $c->get('database.name'), |
||||
$c->get('database.username'), |
||||
$c->get('database.password'), |
||||
[ |
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, |
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION |
||||
] |
||||
); |
||||
}, |
||||
// MAILER |
||||
'mail.to' => 'mailto@admin.fr', |
||||
'mail.from' => 'no-reply@admin.fr', |
||||
Swift_Mailer::class => \DI\factory(\Framework\SwiftMailerFactory::class) |
||||
]; |
Loading…
Reference in new issue