Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit a896aa1

Browse files
committed
refactor(config): Migrate framework.yaml to PHP
1 parent b1557d6 commit a896aa1

File tree

2 files changed

+32
-27
lines changed

2 files changed

+32
-27
lines changed

config/packages/framework.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
use Symfony\Config\Framework\SessionConfig;
7+
use Symfony\Config\FrameworkConfig;
8+
9+
use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
10+
11+
return static function (ContainerConfigurator $containerConfigurator, FrameworkConfig $frameworkConfig): void {
12+
$sessionConfig = $frameworkConfig->session();
13+
assert($sessionConfig instanceof SessionConfig);
14+
15+
$frameworkConfig->secret(env('APP_SECRET'));
16+
17+
$sessionConfig->handlerId(env('REDIS_URI'));
18+
19+
$frameworkConfig->trustedProxies('private_ranges');
20+
$frameworkConfig->trustedHeaders([
21+
'x-forwarded-for',
22+
'x-forwarded-host',
23+
'x-forwarded-proto',
24+
'x-forwarded-port',
25+
'x-forwarded-prefix',
26+
]);
27+
28+
if ('test' === $containerConfigurator->env()) {
29+
$frameworkConfig->test(true);
30+
$sessionConfig->storageFactoryId('session.storage.factory.mock_file');
31+
}
32+
};

config/packages/framework.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)