reboot
This commit is contained in:
parent
3e33b45161
commit
e2a33be4f9
90 changed files with 2842 additions and 6060 deletions
|
@ -1,30 +1,21 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
|
||||
use Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle;
|
||||
use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Bundle\MakerBundle\MakerBundle;
|
||||
use Symfony\Bundle\TwigBundle\TwigBundle;
|
||||
|
||||
return [
|
||||
FrameworkBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
MakerBundle::class => [
|
||||
'dev' => true,
|
||||
],
|
||||
DoctrineBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
DoctrineMigrationsBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
MakerBundle::class => [
|
||||
'dev' => true,
|
||||
],
|
||||
TwigBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
DoctrineFixturesBundle::class => [
|
||||
'dev' => true,
|
||||
'test' => true,
|
||||
],
|
||||
];
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
],
|
||||
);
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
],
|
||||
);
|
||||
]);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
|
@ -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,
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
|
@ -1,9 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
if (
|
||||
file_exists(
|
||||
dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php',
|
||||
)
|
||||
) {
|
||||
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
|
||||
}
|
||||
|
|
|
@ -3,11 +3,8 @@
|
|||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
|
||||
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
$routingConfigurator->import(
|
||||
[
|
||||
'path' => '../src/Controller/',
|
||||
'namespace' => 'App\Controller',
|
||||
],
|
||||
'attribute',
|
||||
);
|
||||
$routingConfigurator->import([
|
||||
'path' => '../src/Controller/',
|
||||
'namespace' => 'App\Controller',
|
||||
], 'attribute');
|
||||
};
|
||||
|
|
|
@ -4,8 +4,7 @@ use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
|||
|
||||
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
if ($routingConfigurator->env() === 'dev') {
|
||||
$routingConfigurator
|
||||
->import('@FrameworkBundle/Resources/config/routing/errors.xml')
|
||||
$routingConfigurator->import('@FrameworkBundle/Resources/config/routing/errors.xml')
|
||||
->prefix('/_error');
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Bridge\Twig\AppVariable;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->defaults()
|
||||
->autowire()
|
||||
->autoconfigure();
|
||||
$services
|
||||
->load('App\\', __DIR__ . '/../src/')
|
||||
|
||||
$services->load('App\\', __DIR__ . '/../src/')
|
||||
->exclude([
|
||||
__DIR__ . '/../src/DependencyInjection/',
|
||||
__DIR__ . '/../src/Entity/',
|
||||
__DIR__ . '/../src/Kernel.php',
|
||||
]);
|
||||
$services->alias(AppVariable::class, 'twig.app_variable');
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue