reboot
All checks were successful
/ ls (pull_request) Successful in 25s
/ ls (push) Successful in 25s

This commit is contained in:
lubiana 2024-06-09 16:43:34 +02:00
parent 3e33b45161
commit e2a33be4f9
No known key found for this signature in database
90 changed files with 2842 additions and 6060 deletions

View file

@ -3,76 +3,66 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension(
'doctrine',
[
'dbal' => [
'url' => '%env(resolve:DATABASE_URL)%',
'profiling_collect_backtrace' => '%kernel.debug%',
],
'orm' => [
'auto_generate_proxy_classes' => true,
'enable_lazy_ghost_objects' => true,
'report_fields_where_declared' => true,
'validate_xml_mapping' => true,
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => true,
'mappings' => [
'App' => [
'type' => 'attribute',
'is_bundle' => false,
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
'alias' => 'App',
],
$containerConfigurator->extension('doctrine', [
'dbal' => [
'url' => '%env(resolve:DATABASE_URL)%',
'profiling_collect_backtrace' => '%kernel.debug%',
'use_savepoints' => true,
],
'orm' => [
'auto_generate_proxy_classes' => true,
'enable_lazy_ghost_objects' => true,
'report_fields_where_declared' => true,
'validate_xml_mapping' => true,
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => true,
'mappings' => [
'App' => [
'type' => 'attribute',
'is_bundle' => false,
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
'alias' => 'App',
],
],
'controller_resolver' => [
'auto_mapping' => false,
],
],
);
]);
if ($containerConfigurator->env() === 'test') {
$containerConfigurator->extension(
'doctrine',
[
'dbal' => [
'dbname_suffix' => '_test%env(default::TEST_TOKEN)%',
],
$containerConfigurator->extension('doctrine', [
'dbal' => [
'dbname_suffix' => '_test%env(default::TEST_TOKEN)%',
],
);
]);
}
if ($containerConfigurator->env() === 'prod') {
$containerConfigurator->extension(
'doctrine',
[
'orm' => [
'auto_generate_proxy_classes' => false,
'proxy_dir' => '%kernel.build_dir%/doctrine/orm/Proxies',
'query_cache_driver' => [
'type' => 'pool',
'pool' => 'doctrine.system_cache_pool',
$containerConfigurator->extension('doctrine', [
'orm' => [
'auto_generate_proxy_classes' => false,
'proxy_dir' => '%kernel.build_dir%/doctrine/orm/Proxies',
'query_cache_driver' => [
'type' => 'pool',
'pool' => 'doctrine.system_cache_pool',
],
'result_cache_driver' => [
'type' => 'pool',
'pool' => 'doctrine.result_cache_pool',
],
],
]);
$containerConfigurator->extension('framework', [
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => [
'adapter' => 'cache.app',
],
'result_cache_driver' => [
'type' => 'pool',
'pool' => 'doctrine.result_cache_pool',
'doctrine.system_cache_pool' => [
'adapter' => 'cache.system',
],
],
],
);
$containerConfigurator->extension(
'framework',
[
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => [
'adapter' => 'cache.app',
],
'doctrine.system_cache_pool' => [
'adapter' => 'cache.system',
],
],
],
],
);
]);
}
};

View file

@ -3,13 +3,10 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension(
'doctrine_migrations',
[
'migrations_paths' => [
'DoctrineMigrations' => '%kernel.project_dir%/migrations',
],
'enable_profiler' => false,
$containerConfigurator->extension('doctrine_migrations', [
'migrations_paths' => [
'DoctrineMigrations' => '%kernel.project_dir%/migrations',
],
);
'enable_profiler' => false,
]);
};

View file

@ -3,23 +3,16 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension(
'framework',
[
'secret' => '%env(APP_SECRET)%',
'session' => true,
],
);
$containerConfigurator->extension('framework', [
'secret' => '%env(APP_SECRET)%',
'session' => true,
]);
if ($containerConfigurator->env() === 'test') {
$containerConfigurator->extension(
'framework',
[
'test' => true,
'session' => [
'storage_factory_id' => 'session.storage.factory.mock_file',
],
$containerConfigurator->extension('framework', [
'test' => true,
'session' => [
'storage_factory_id' => 'session.storage.factory.mock_file',
],
);
]);
}
};

View file

@ -6,15 +6,11 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('framework', [
'router' => null,
]);
if ($containerConfigurator->env() === 'prod') {
$containerConfigurator->extension(
'framework',
[
'router' => [
'strict_requirements' => null,
],
$containerConfigurator->extension('framework', [
'router' => [
'strict_requirements' => null,
],
);
]);
}
};

View file

@ -1,16 +0,0 @@
<?php declare(strict_types=1);
use App\Service\WhoAreYou;
// config/packages/twig.php
use Symfony\Config\TwigConfig;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
return static function (TwigConfig $twig): void {
$twig->fileNamePattern('*.twig')
->global('username', service(WhoAreYou::class));
if ($_SERVER['APP_ENV'] === 'test') {
$twig->strictVariables(true);
}
};

View file

@ -1,20 +0,0 @@
<?php declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->extension('framework', [
'validation' => null,
]);
if ($containerConfigurator->env() === 'test') {
$containerConfigurator->extension(
'framework',
[
'validation' => [
'not_compromised_password' => false,
],
],
);
}
};