28 lines
879 B
PHP
28 lines
879 B
PHP
<?php
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use Symfony\Config\FrameworkConfig;
|
|
|
|
return static function (FrameworkConfig $framework, ContainerConfigurator $container): void {
|
|
|
|
$framework->secret('%env(APP_SECRET)%');
|
|
$framework->httpMethodOverride(false);
|
|
$framework->handleAllThrowables(true);
|
|
|
|
$framework->session()
|
|
->handlerId(null)
|
|
->cookieSecure("auto")
|
|
->cookieSamesite("lax")
|
|
->storageFactoryId("session.storage.factory.native");
|
|
|
|
$framework->phpErrors(["log" => true]);
|
|
|
|
if ($container->env() === "test") {
|
|
$framework->test(true);
|
|
$framework->session()->storageFactoryId("session.storage.factory.mock_file");
|
|
}
|
|
|
|
if ($container->env() === "prod") {
|
|
$framework->session()->handlerId('file://%kernel.project_dir%/var/sessions');
|
|
}
|
|
};
|