Website/app/config/packages/framework.php

38 lines
1.2 KiB
PHP
Raw Normal View History

2024-04-22 20:26:40 +00:00
<?php
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('framework', [
'secret' => '%env(APP_SECRET)%',
'http_method_override' => false,
'handle_all_throwables' => true,
'session' => [
'handler_id' => null,
'cookie_secure' => 'auto',
'cookie_samesite' => 'lax',
'storage_factory_id' => 'session.storage.factory.native',
],
'php_errors' => [
'log' => true,
],
]);
if ($containerConfigurator->env() === 'test') {
$containerConfigurator->extension('framework', [
'test' => true,
'session' => [
'storage_factory_id' => 'session.storage.factory.mock_file',
],
]);
}
if ($containerConfigurator->env() === 'prod') {
$containerConfigurator->extension('framework', [
'session' => [
'handler_id' => 'file://%kernel_project_dir%/var/sessions',
],
]);
}
};