init
This commit is contained in:
commit
203233d2ed
71 changed files with 8213 additions and 0 deletions
30
config/bundles.php
Normal file
30
config/bundles.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?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,
|
||||
],
|
||||
DoctrineBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
DoctrineMigrationsBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
MakerBundle::class => [
|
||||
'dev' => true,
|
||||
],
|
||||
TwigBundle::class => [
|
||||
'all' => true,
|
||||
],
|
||||
DoctrineFixturesBundle::class => [
|
||||
'dev' => true,
|
||||
'test' => 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,
|
||||
]);
|
||||
};
|
78
config/packages/doctrine.php
Normal file
78
config/packages/doctrine.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?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%',
|
||||
],
|
||||
'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',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
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',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
15
config/packages/doctrine_migrations.php
Normal file
15
config/packages/doctrine_migrations.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?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,
|
||||
],
|
||||
);
|
||||
};
|
25
config/packages/framework.php
Normal file
25
config/packages/framework.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?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',
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
20
config/packages/routing.php
Normal file
20
config/packages/routing.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?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,
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
15
config/packages/twig.php
Normal file
15
config/packages/twig.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('twig', [
|
||||
'file_name_pattern' => '*.twig',
|
||||
]);
|
||||
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$containerConfigurator->extension('twig', [
|
||||
'strict_variables' => true,
|
||||
]);
|
||||
}
|
||||
};
|
20
config/packages/validator.php
Normal file
20
config/packages/validator.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?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,
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
};
|
9
config/preload.php
Normal file
9
config/preload.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?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';
|
||||
}
|
13
config/routes.php
Normal file
13
config/routes.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?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',
|
||||
);
|
||||
};
|
11
config/routes/framework.php
Normal file
11
config/routes/framework.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?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');
|
||||
}
|
||||
};
|
17
config/services.php
Normal file
17
config/services.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?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