Website/config/packages/framework.php

29 lines
879 B
PHP
Raw Normal View History

2024-04-22 20:26:40 +00:00
<?php
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2024-07-12 22:56:04 +00:00
use Symfony\Config\FrameworkConfig;
return static function (FrameworkConfig $framework, ContainerConfigurator $container): void {
$framework->secret('%env(APP_SECRET)%');
$framework->httpMethodOverride(false);
$framework->handleAllThrowables(true);
2024-04-22 20:26:40 +00:00
2024-07-12 22:56:04 +00:00
$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");
2024-04-22 20:26:40 +00:00
}
2024-07-12 22:56:04 +00:00
if ($container->env() === "prod") {
$framework->session()->handlerId('file://%kernel.project_dir%/var/sessions');
2024-04-22 20:26:40 +00:00
}
};