vibe
This commit is contained in:
parent
837cfb6d43
commit
939840a3ac
76 changed files with 6636 additions and 83 deletions
|
@ -2,4 +2,9 @@
|
|||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
];
|
||||
|
|
11
config/packages/cache.php
Normal file
11
config/packages/cache.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'cache' => null,
|
||||
]);
|
||||
};
|
|
@ -1,19 +0,0 @@
|
|||
framework:
|
||||
cache:
|
||||
# Unique name of your app: used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The "app" cache stores to the filesystem by default.
|
||||
# The data in this cache should persist between deploys.
|
||||
# Other options include:
|
||||
|
||||
# Redis
|
||||
#app: cache.adapter.redis
|
||||
#default_redis_provider: redis://localhost
|
||||
|
||||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
|
||||
#app: cache.adapter.apcu
|
||||
|
||||
# Namespaced pools use the above "app" backend by default
|
||||
#pools:
|
||||
#my.dedicated.cache: null
|
22
config/packages/csrf.php
Normal file
22
config/packages/csrf.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'form' => [
|
||||
'csrf_protection' => [
|
||||
'token_id' => 'submit',
|
||||
],
|
||||
],
|
||||
'csrf_protection' => [
|
||||
'stateless_token_ids' => [
|
||||
'submit',
|
||||
'authenticate',
|
||||
'logout',
|
||||
],
|
||||
],
|
||||
]);
|
||||
};
|
74
config/packages/doctrine.php
Normal file
74
config/packages/doctrine.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
|
||||
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',
|
||||
'identity_generation_preferences' => [
|
||||
PostgreSQLPlatform::class => 'identity',
|
||||
],
|
||||
'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',
|
||||
],
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
14
config/packages/doctrine_migrations.php
Normal file
14
config/packages/doctrine_migrations.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?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,
|
||||
]);
|
||||
};
|
20
config/packages/framework.php
Normal file
20
config/packages/framework.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', [
|
||||
'secret' => '%env(APP_SECRET)%',
|
||||
'session' => true,
|
||||
]);
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'test' => true,
|
||||
'session' => [
|
||||
'storage_factory_id' => 'session.storage.factory.mock_file',
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
|
@ -1,15 +0,0 @@
|
|||
# see https://symfony.com/doc/current/reference/configuration/framework.html
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
|
||||
# Note that the session will be started ONLY if you read or write from it.
|
||||
session: true
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
|
||||
when@test:
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_factory_id: session.storage.factory.mock_file
|
13
config/packages/property_info.php
Normal file
13
config/packages/property_info.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'property_info' => [
|
||||
'with_constructor_extractor' => true,
|
||||
],
|
||||
]);
|
||||
};
|
18
config/packages/routing.php
Normal file
18
config/packages/routing.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', [
|
||||
'router' => null,
|
||||
]);
|
||||
if ($containerConfigurator->env() === 'prod') {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'router' => [
|
||||
'strict_requirements' => null,
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
|
@ -1,10 +0,0 @@
|
|||
framework:
|
||||
router:
|
||||
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
||||
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
||||
#default_uri: http://localhost
|
||||
|
||||
when@prod:
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: null
|
16
config/packages/twig.php
Normal file
16
config/packages/twig.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Service\Config\AppName;
|
||||
use Symfony\Config\TwigConfig;
|
||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator, TwigConfig $twig): void {
|
||||
$twig->fileNamePattern('*.twig');
|
||||
$twig->formThemes(['bootstrap_5_layout.html.twig']);
|
||||
$twig->global('appName', \Symfony\Component\DependencyInjection\Loader\Configurator\service(AppName::class));
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$twig->strictVariables(true);
|
||||
}
|
||||
};
|
18
config/packages/validator.php
Normal file
18
config/packages/validator.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', [
|
||||
'validation' => null,
|
||||
]);
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'validation' => [
|
||||
'not_compromised_password' => false,
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
25
config/packages/web_profiler.php
Normal file
25
config/packages/web_profiler.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 {
|
||||
if ($containerConfigurator->env() === 'dev') {
|
||||
$containerConfigurator->extension('web_profiler', [
|
||||
'toolbar' => true,
|
||||
]);
|
||||
$containerConfigurator->extension('framework', [
|
||||
'profiler' => [
|
||||
'collect_serializer_data' => true,
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($containerConfigurator->env() === 'test') {
|
||||
$containerConfigurator->extension('framework', [
|
||||
'profiler' => [
|
||||
'collect' => false,
|
||||
],
|
||||
]);
|
||||
}
|
||||
};
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
|
||||
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.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';
|
||||
}
|
||||
|
|
12
config/routes.php
Normal file
12
config/routes.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?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');
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
controllers:
|
||||
resource:
|
||||
path: ../src/Controller/
|
||||
namespace: App\Controller
|
||||
type: attribute
|
12
config/routes/framework.php
Normal file
12
config/routes/framework.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?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.php')
|
||||
->prefix('/_error');
|
||||
}
|
||||
};
|
|
@ -1,4 +0,0 @@
|
|||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.php'
|
||||
prefix: /_error
|
14
config/routes/web_profiler.php
Normal file
14
config/routes/web_profiler.php
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||
|
||||
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||
if ($routingConfigurator->env() === 'dev') {
|
||||
$routingConfigurator->import('@WebProfilerBundle/Resources/config/routing/wdt.php')
|
||||
->prefix('/_wdt');
|
||||
$routingConfigurator->import('@WebProfilerBundle/Resources/config/routing/profiler.php')
|
||||
->prefix('/_profiler');
|
||||
}
|
||||
};
|
15
config/services.php
Normal file
15
config/services.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 {
|
||||
$services = $containerConfigurator->services();
|
||||
|
||||
$services->defaults()
|
||||
->autowire()
|
||||
->autoconfigure();
|
||||
|
||||
$services->load('App\\', __DIR__ . '/../src/');
|
||||
};
|
|
@ -1,20 +0,0 @@
|
|||
# This file is the entry point to configure your own services.
|
||||
# Files in the packages/ subdirectory configure your dependencies.
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
autowire: true # Automatically injects dependencies in your services.
|
||||
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
|
||||
|
||||
# makes classes in src/ available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
App\:
|
||||
resource: '../src/'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
Loading…
Add table
Add a link
Reference in a new issue