commit
a32bf4ce7d
33 changed files with 7427 additions and 0 deletions
21
config/bundles.php
Normal file
21
config/bundles.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
|
||||
use Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Bundle\MakerBundle\MakerBundle;
|
||||
|
||||
return [
|
||||
FrameworkBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
MakerBundle::class => [
|
||||
'dev' => true,
|
||||
],
|
||||
DoctrineBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
DoctrineMigrationsBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
];
|
9
config/packages/cache.php
Normal file
9
config/packages/cache.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'cache' => null,
|
||||
]);
|
||||
};
|
68
config/packages/doctrine.php
Normal file
68
config/packages/doctrine.php
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
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%',
|
||||
'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)%',
|
||||
],
|
||||
]);
|
||||
}
|
||||
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',
|
||||
],
|
||||
'result_cache_driver' => [
|
||||
'type' => 'pool',
|
||||
'pool' => 'doctrine.result_cache_pool',
|
||||
],
|
||||
],
|
||||
]);
|
||||
$containerConfigurator->extension('framework', [
|
||||
'cache' => [
|
||||
'pools' => [
|
||||
'doctrine.result_cache_pool' => [
|
||||
'adapter' => 'cache.app',
|
||||
],
|
||||
'doctrine.system_cache_pool' => [
|
||||
'adapter' => 'cache.system',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
12
config/packages/doctrine_migrations.php
Normal file
12
config/packages/doctrine_migrations.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
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,
|
||||
]);
|
||||
};
|
18
config/packages/framework.php
Normal file
18
config/packages/framework.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$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',
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
16
config/packages/routing.php
Normal file
16
config/packages/routing.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'router' => null,
|
||||
]);
|
||||
if ($containerConfigurator->env() === 'prod') {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'router' => [
|
||||
'strict_requirements' => null,
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
5
config/preload.php
Normal file
5
config/preload.php
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php';
|
||||
}
|
10
config/routes.php
Normal file
10
config/routes.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
|
||||
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
$routingConfigurator->import([
|
||||
'path' => '../src/Controller/',
|
||||
'namespace' => 'App\Controller',
|
||||
], 'attribute');
|
||||
};
|
10
config/routes/framework.php
Normal file
10
config/routes/framework.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
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')
|
||||
->prefix('/_error');
|
||||
}
|
||||
};
|
18
config/services.php
Normal file
18
config/services.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
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/')
|
||||
->exclude([
|
||||
__DIR__ . '/../src/DependencyInjection/',
|
||||
__DIR__ . '/../src/Entity/',
|
||||
__DIR__ . '/../src/Kernel.php',
|
||||
]);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue