Skip to content

Commit 9154037

Browse files
committed
convert config to php
1 parent 8e5178f commit 9154037

28 files changed

+362
-230
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"symfony/browser-kit": "7.0.*",
8080
"symfony/css-selector": "7.0.*",
8181
"symfony/maker-bundle": "^1.49",
82-
"symfony/phpunit-bridge": "^7.0"
82+
"symfony/phpunit-bridge": "^7.0",
83+
"symplify/config-transformer": "^12.3"
8384
}
8485
}

composer.lock

+43-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/packages/cache.php

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('framework', [
9+
'cache' => null,
10+
]);
11+
};

config/packages/cache.yaml

-19
This file was deleted.

config/packages/doctrine.php

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('doctrine', [
9+
'dbal' => [
10+
'url' => '%env(resolve:DATABASE_URL)%',
11+
],
12+
'orm' => [
13+
'auto_generate_proxy_classes' => true,
14+
'enable_lazy_ghost_objects' => true,
15+
'report_fields_where_declared' => true,
16+
'validate_xml_mapping' => true,
17+
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
18+
'auto_mapping' => true,
19+
'mappings' => [
20+
'User' => [
21+
'is_bundle' => false,
22+
'dir' => '%kernel.project_dir%/src/User/Entity',
23+
'prefix' => 'App\User\Entity',
24+
'alias' => 'User',
25+
],
26+
],
27+
],
28+
]);
29+
if ($containerConfigurator->env() === 'test') {
30+
$containerConfigurator->extension('doctrine', [
31+
'dbal' => [
32+
'dbname_suffix' => '_test%env(default::TEST_TOKEN)%',
33+
],
34+
]);
35+
}
36+
if ($containerConfigurator->env() === 'prod') {
37+
$containerConfigurator->extension('doctrine', [
38+
'orm' => [
39+
'auto_generate_proxy_classes' => false,
40+
'proxy_dir' => '%kernel.build_dir%/doctrine/orm/Proxies',
41+
'query_cache_driver' => [
42+
'type' => 'pool',
43+
'pool' => 'doctrine.system_cache_pool',
44+
],
45+
'result_cache_driver' => [
46+
'type' => 'pool',
47+
'pool' => 'doctrine.result_cache_pool',
48+
],
49+
],
50+
]);
51+
$containerConfigurator->extension('framework', [
52+
'cache' => [
53+
'pools' => [
54+
'doctrine.result_cache_pool' => [
55+
'adapter' => 'cache.app',
56+
],
57+
'doctrine.system_cache_pool' => [
58+
'adapter' => 'cache.system',
59+
],
60+
],
61+
],
62+
]);
63+
}
64+
};

config/packages/doctrine.yaml

-46
This file was deleted.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('doctrine_migrations', [
9+
'migrations_paths' => [
10+
'DoctrineMigrations' => '%kernel.project_dir%/migrations',
11+
],
12+
'enable_profiler' => false,
13+
]);
14+
};

config/packages/doctrine_migrations.yaml

-6
This file was deleted.

config/packages/framework.php

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('framework', [
9+
'secret' => '%env(APP_SECRET)%',
10+
'http_method_override' => false,
11+
'handle_all_throwables' => true,
12+
'session' => [
13+
'handler_id' => null,
14+
'cookie_secure' => 'auto',
15+
'cookie_samesite' => 'lax',
16+
'storage_factory_id' => 'session.storage.factory.native',
17+
],
18+
'php_errors' => [
19+
'log' => true,
20+
],
21+
]);
22+
if ($containerConfigurator->env() === 'test') {
23+
$containerConfigurator->extension('framework', [
24+
'test' => true,
25+
'session' => [
26+
'storage_factory_id' => 'session.storage.factory.mock_file',
27+
],
28+
]);
29+
}
30+
};

config/packages/framework.yaml

-25
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('lexik_jwt_authentication', [
9+
'secret_key' => '%env(resolve:JWT_SECRET_KEY)%',
10+
'public_key' => '%env(resolve:JWT_PUBLIC_KEY)%',
11+
'pass_phrase' => '%env(JWT_PASSPHRASE)%',
12+
]);
13+
};

config/packages/lexik_jwt_authentication.yaml

-4
This file was deleted.

config/packages/routing.php

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6+
7+
return static function (ContainerConfigurator $containerConfigurator): void {
8+
$containerConfigurator->extension('framework', [
9+
'router' => [
10+
'utf8' => true,
11+
],
12+
]);
13+
if ($containerConfigurator->env() === 'prod') {
14+
$containerConfigurator->extension('framework', [
15+
'router' => [
16+
'strict_requirements' => null,
17+
],
18+
]);
19+
}
20+
};

config/packages/routing.yaml

-12
This file was deleted.

0 commit comments

Comments
 (0)