Convert config to php
This commit is contained in:
parent
8897d1890f
commit
28f184dd68
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]);
|
||||||
|
};
|
@ -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
|
|
13
config/packages/dev/easy_log_handler.php
Normal file
13
config/packages/dev/easy_log_handler.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 {
|
||||||
|
$services = $containerConfigurator->services();
|
||||||
|
|
||||||
|
$services->set('EasyCorp\EasyLog\EasyLogHandler')
|
||||||
|
->private()
|
||||||
|
->args(['%kernel.logs_dir%/%kernel.environment%.log']);
|
||||||
|
};
|
@ -1,16 +0,0 @@
|
|||||||
services:
|
|
||||||
EasyCorp\EasyLog\EasyLogHandler:
|
|
||||||
public: false
|
|
||||||
arguments: ['%kernel.logs_dir%/%kernel.environment%.log']
|
|
||||||
|
|
||||||
#// FIXME: How to add this configuration automatically without messing up with the monolog configuration?
|
|
||||||
#monolog:
|
|
||||||
# handlers:
|
|
||||||
# buffered:
|
|
||||||
# type: buffer
|
|
||||||
# handler: easylog
|
|
||||||
# channels: ['!event']
|
|
||||||
# level: debug
|
|
||||||
# easylog:
|
|
||||||
# type: service
|
|
||||||
# id: EasyCorp\EasyLog\EasyLogHandler
|
|
9
config/packages/dev/monolog.php
Normal file
9
config/packages/dev/monolog.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('monolog', ['handlers' => ['main' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', 'channels' => ['!event']], 'console' => ['type' => 'console', 'process_psr_3_messages' => false, 'channels' => ['!event', '!doctrine', '!console']]]]);
|
||||||
|
};
|
@ -1,19 +0,0 @@
|
|||||||
monolog:
|
|
||||||
handlers:
|
|
||||||
main:
|
|
||||||
type: stream
|
|
||||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
||||||
level: debug
|
|
||||||
channels: ["!event"]
|
|
||||||
# uncomment to get logging in your browser
|
|
||||||
# you may have to allow bigger header sizes in your Web server configuration
|
|
||||||
#firephp:
|
|
||||||
# type: firephp
|
|
||||||
# level: info
|
|
||||||
#chromephp:
|
|
||||||
# type: chromephp
|
|
||||||
# level: info
|
|
||||||
console:
|
|
||||||
type: console
|
|
||||||
process_psr_3_messages: false
|
|
||||||
channels: ["!event", "!doctrine", "!console"]
|
|
9
config/packages/dev/routing.php
Normal file
9
config/packages/dev/routing.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', ['router' => ['strict_requirements' => true]]);
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
framework:
|
|
||||||
router:
|
|
||||||
strict_requirements: true
|
|
11
config/packages/dev/web_profiler.php
Normal file
11
config/packages/dev/web_profiler.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('web_profiler', ['toolbar' => true, 'intercept_redirects' => false]);
|
||||||
|
|
||||||
|
$containerConfigurator->extension('framework', ['profiler' => ['only_exceptions' => false]]);
|
||||||
|
};
|
@ -1,6 +0,0 @@
|
|||||||
web_profiler:
|
|
||||||
toolbar: true
|
|
||||||
intercept_redirects: false
|
|
||||||
|
|
||||||
framework:
|
|
||||||
profiler: { only_exceptions: false }
|
|
34
config/packages/doctrine.php
Normal file
34
config/packages/doctrine.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use App\Types\MoneyType;
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$parameters = $containerConfigurator->parameters();
|
||||||
|
|
||||||
|
$parameters->set('env(DATABASE_URL)', '');
|
||||||
|
|
||||||
|
$containerConfigurator->extension('doctrine', [
|
||||||
|
'dbal' => [
|
||||||
|
'driver' => 'pdo_pgsql',
|
||||||
|
'types' => ['money' => MoneyType::class],
|
||||||
|
'mapping_types' => ['bit' => 'boolean', 'money' => 'money'],
|
||||||
|
'url' => '%env(DATABASE_URL)%'
|
||||||
|
],
|
||||||
|
'orm' => [
|
||||||
|
'auto_generate_proxy_classes' => '%kernel.debug%',
|
||||||
|
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
|
||||||
|
'auto_mapping' => TRUE,
|
||||||
|
'mappings' => [
|
||||||
|
'App' => [
|
||||||
|
'is_bundle' => FALSE,
|
||||||
|
'type' => 'attribute',
|
||||||
|
'dir' => '%kernel.project_dir%/src/Entity',
|
||||||
|
'prefix' => 'App\Entity',
|
||||||
|
'alias' => 'App']
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
};
|
@ -1,30 +0,0 @@
|
|||||||
parameters:
|
|
||||||
# Adds a fallback DATABASE_URL if the env var is not set.
|
|
||||||
# This allows you to run cache:warmup even if your
|
|
||||||
# environment variables are not available yet.
|
|
||||||
# You should not need to change this value.
|
|
||||||
env(DATABASE_URL): ''
|
|
||||||
|
|
||||||
doctrine:
|
|
||||||
dbal:
|
|
||||||
# configure these for your database server
|
|
||||||
driver: 'pdo_pgsql'
|
|
||||||
types:
|
|
||||||
money: App\Types\MoneyType
|
|
||||||
mapping_types:
|
|
||||||
bit: boolean
|
|
||||||
money: money
|
|
||||||
|
|
||||||
# With Symfony 3.3, remove the `resolve:` prefix
|
|
||||||
url: '%env(DATABASE_URL)%'
|
|
||||||
orm:
|
|
||||||
auto_generate_proxy_classes: '%kernel.debug%'
|
|
||||||
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
|
|
||||||
auto_mapping: true
|
|
||||||
mappings:
|
|
||||||
App:
|
|
||||||
is_bundle: false
|
|
||||||
type: attribute
|
|
||||||
dir: '%kernel.project_dir%/src/Entity'
|
|
||||||
prefix: 'App\Entity'
|
|
||||||
alias: App
|
|
8
config/packages/doctrine_migrations.php
Normal file
8
config/packages/doctrine_migrations.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Config\DoctrineMigrationsConfig;
|
||||||
|
|
||||||
|
return static function (DoctrineMigrationsConfig $doctrineMigrations): void {
|
||||||
|
$doctrineMigrations->migrationsPath('App\\Migrations', '%kernel.project_dir%/src/Migrations')
|
||||||
|
->checkDatabasePlatform(true);
|
||||||
|
};
|
@ -1,4 +0,0 @@
|
|||||||
doctrine_migrations:
|
|
||||||
migrations_paths:
|
|
||||||
'App\Migrations': '%kernel.project_dir%/src/Migrations'
|
|
||||||
check_database_platform: true
|
|
15
config/packages/framework.php
Normal file
15
config/packages/framework.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('framework', [
|
||||||
|
'secret' => '%env(APP_SECRET)%',
|
||||||
|
'default_locale' => 'en',
|
||||||
|
'http_method_override' => false,
|
||||||
|
'session' => ['handler_id' => null],
|
||||||
|
'php_errors' => ['log' => true]
|
||||||
|
]);
|
||||||
|
};
|
@ -1,17 +0,0 @@
|
|||||||
framework:
|
|
||||||
secret: '%env(APP_SECRET)%'
|
|
||||||
default_locale: en
|
|
||||||
#csrf_protection: ~
|
|
||||||
http_method_override: false
|
|
||||||
#trusted_hosts: ~
|
|
||||||
|
|
||||||
# uncomment this entire section to enable sessions
|
|
||||||
session:
|
|
||||||
# With this config, PHP's native session handling is used
|
|
||||||
handler_id: ~
|
|
||||||
#storage_id: session.storage.factory.native
|
|
||||||
|
|
||||||
#esi: ~
|
|
||||||
#fragments: ~
|
|
||||||
php_errors:
|
|
||||||
log: true
|
|
0
config/packages/prod/deprecations.php
Normal file
0
config/packages/prod/deprecations.php
Normal file
@ -1,8 +0,0 @@
|
|||||||
# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists
|
|
||||||
#monolog:
|
|
||||||
# channels: [deprecation]
|
|
||||||
# handlers:
|
|
||||||
# deprecation:
|
|
||||||
# type: stream
|
|
||||||
# channels: [deprecation]
|
|
||||||
# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
|
|
22
config/packages/prod/doctrine.php
Normal file
22
config/packages/prod/doctrine.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$containerConfigurator->extension('doctrine', ['orm' => ['metadata_cache_driver' => ['type' => 'service', 'id' => 'doctrine.system_cache_provider'], 'query_cache_driver' => ['type' => 'service', 'id' => 'doctrine.system_cache_provider'], 'result_cache_driver' => ['type' => 'service', 'id' => 'doctrine.result_cache_provider']]]);
|
||||||
|
|
||||||
|
$services = $containerConfigurator->services();
|
||||||
|
|
||||||
|
$services->set('doctrine.result_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
|
||||||
|
->private()
|
||||||
|
->args([service('doctrine.result_cache_pool')]);
|
||||||
|
|
||||||
|
$services->set('doctrine.system_cache_provider', 'Symfony\Component\Cache\DoctrineProvider')
|
||||||
|
->private()
|
||||||
|
->args([service('doctrine.system_cache_pool')]);
|
||||||
|
|
||||||
|
$containerConfigurator->extension('framework', ['cache' => ['pools' => ['doctrine.result_cache_pool' => ['adapter' => 'cache.app'], 'doctrine.system_cache_pool' => ['adapter' => 'cache.system']]]]);
|
||||||
|
};
|
@ -1,31 +0,0 @@
|
|||||||
doctrine:
|
|
||||||
orm:
|
|
||||||
metadata_cache_driver:
|
|
||||||
type: service
|
|
||||||
id: doctrine.system_cache_provider
|
|
||||||
query_cache_driver:
|
|
||||||
type: service
|
|
||||||
id: doctrine.system_cache_provider
|
|
||||||
result_cache_driver:
|
|
||||||
type: service
|
|
||||||
id: doctrine.result_cache_provider
|
|
||||||
|
|
||||||
services:
|
|
||||||
doctrine.result_cache_provider:
|
|
||||||
class: Symfony\Component\Cache\DoctrineProvider
|
|
||||||
public: false
|
|
||||||
arguments:
|
|
||||||
- '@doctrine.result_cache_pool'
|
|
||||||
doctrine.system_cache_provider:
|
|
||||||
class: Symfony\Component\Cache\DoctrineProvider
|
|
||||||
public: false
|
|
||||||
arguments:
|
|
||||||
- '@doctrine.system_cache_pool'
|
|
||||||
|
|
||||||
framework:
|
|
||||||
cache:
|
|
||||||
pools:
|
|
||||||
doctrine.result_cache_pool:
|
|
||||||
adapter: cache.app
|
|
||||||
doctrine.system_cache_pool:
|
|
||||||
adapter: cache.system
|
|
9
config/packages/prod/monolog.php
Normal file
9
config/packages/prod/monolog.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('monolog', ['handlers' => ['main' => ['type' => 'fingers_crossed', 'action_level' => 'error', 'handler' => 'nested', 'excluded_404s' => ['^/']], 'nested' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug'], 'console' => ['type' => 'console', 'process_psr_3_messages' => false, 'channels' => ['!event', '!doctrine']]]]);
|
||||||
|
};
|
@ -1,17 +0,0 @@
|
|||||||
monolog:
|
|
||||||
handlers:
|
|
||||||
main:
|
|
||||||
type: fingers_crossed
|
|
||||||
action_level: error
|
|
||||||
handler: nested
|
|
||||||
excluded_404s:
|
|
||||||
# regex: exclude all 404 errors from the logs
|
|
||||||
- ^/
|
|
||||||
nested:
|
|
||||||
type: stream
|
|
||||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
||||||
level: debug
|
|
||||||
console:
|
|
||||||
type: console
|
|
||||||
process_psr_3_messages: false
|
|
||||||
channels: ["!event", "!doctrine"]
|
|
9
config/packages/prod/routing.php
Normal file
9
config/packages/prod/routing.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', ['router' => ['strict_requirements' => null]]);
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
framework:
|
|
||||||
router:
|
|
||||||
strict_requirements: null
|
|
9
config/packages/routing.php
Normal file
9
config/packages/routing.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', ['router' => ['strict_requirements' => null, 'utf8' => true]]);
|
||||||
|
};
|
@ -1,4 +0,0 @@
|
|||||||
framework:
|
|
||||||
router:
|
|
||||||
strict_requirements: ~
|
|
||||||
utf8: true
|
|
13
config/packages/security.php
Normal file
13
config/packages/security.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||||
|
|
||||||
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
|
$containerConfigurator->extension('security', ['password_hashers' => [PasswordAuthenticatedUserInterface::class => 'auto'], 'providers' => ['users_in_memory' => ['memory' => null]], 'firewalls' => ['dev' => ['pattern' => '^/(_(profiler|wdt)|css|images|js)/', 'security' => false], 'main' => ['lazy' => true, 'provider' => 'users_in_memory']], 'access_control' => null]);
|
||||||
|
if ($containerConfigurator->env() === 'test') {
|
||||||
|
$containerConfigurator->extension('security', ['password_hashers' => [PasswordAuthenticatedUserInterface::class => ['algorithm' => 'auto', 'cost' => 4, 'time_cost' => 3, 'memory_cost' => 10]]]);
|
||||||
|
}
|
||||||
|
};
|
@ -1,39 +0,0 @@
|
|||||||
security:
|
|
||||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
|
||||||
password_hashers:
|
|
||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
|
||||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
|
||||||
providers:
|
|
||||||
users_in_memory: { memory: null }
|
|
||||||
firewalls:
|
|
||||||
dev:
|
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
|
||||||
security: false
|
|
||||||
main:
|
|
||||||
lazy: true
|
|
||||||
provider: users_in_memory
|
|
||||||
|
|
||||||
# activate different ways to authenticate
|
|
||||||
# https://symfony.com/doc/current/security.html#the-firewall
|
|
||||||
|
|
||||||
# https://symfony.com/doc/current/security/impersonating_user.html
|
|
||||||
# switch_user: true
|
|
||||||
|
|
||||||
# Easy way to control access for large sections of your site
|
|
||||||
# Note: Only the *first* access control that matches will be used
|
|
||||||
access_control:
|
|
||||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
|
||||||
# - { path: ^/profile, roles: ROLE_USER }
|
|
||||||
|
|
||||||
when@test:
|
|
||||||
security:
|
|
||||||
password_hashers:
|
|
||||||
# By default, password hashers are resource intensive and take time. This is
|
|
||||||
# important to generate secure password hashes. In tests however, secure hashes
|
|
||||||
# are not important, waste resources and increase test times. The following
|
|
||||||
# reduces the work factor to the lowest possible values.
|
|
||||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
|
|
||||||
algorithm: auto
|
|
||||||
cost: 4 # Lowest possible value for bcrypt
|
|
||||||
time_cost: 3 # Lowest possible value for argon
|
|
||||||
memory_cost: 10 # Lowest possible value for argon
|
|
9
config/packages/sensio_framework_extra.php
Normal file
9
config/packages/sensio_framework_extra.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('sensio_framework_extra', ['router' => ['annotations' => false]]);
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
sensio_framework_extra:
|
|
||||||
router:
|
|
||||||
annotations: false
|
|
9
config/packages/test/framework.php
Normal file
9
config/packages/test/framework.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', ['test' => null]);
|
||||||
|
};
|
@ -1,4 +0,0 @@
|
|||||||
framework:
|
|
||||||
test: ~
|
|
||||||
#session:
|
|
||||||
# storage_id: session.storage.mock_file
|
|
9
config/packages/test/monolog.php
Normal file
9
config/packages/test/monolog.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('monolog', ['handlers' => ['main' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', 'channels' => ['!event']]]]);
|
||||||
|
};
|
@ -1,7 +0,0 @@
|
|||||||
monolog:
|
|
||||||
handlers:
|
|
||||||
main:
|
|
||||||
type: stream
|
|
||||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
|
||||||
level: debug
|
|
||||||
channels: ["!event"]
|
|
9
config/packages/test/twig.php
Normal file
9
config/packages/test/twig.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('twig', ['strict_variables' => true]);
|
||||||
|
};
|
@ -1,2 +0,0 @@
|
|||||||
twig:
|
|
||||||
strict_variables: true
|
|
9
config/packages/test/validator.php
Normal file
9
config/packages/test/validator.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', ['validation' => ['not_compromised_password' => false]]);
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
framework:
|
|
||||||
validation:
|
|
||||||
not_compromised_password: false
|
|
11
config/packages/test/web_profiler.php
Normal file
11
config/packages/test/web_profiler.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('web_profiler', ['toolbar' => false, 'intercept_redirects' => false]);
|
||||||
|
|
||||||
|
$containerConfigurator->extension('framework', ['profiler' => ['collect' => false]]);
|
||||||
|
};
|
@ -1,6 +0,0 @@
|
|||||||
web_profiler:
|
|
||||||
toolbar: false
|
|
||||||
intercept_redirects: false
|
|
||||||
|
|
||||||
framework:
|
|
||||||
profiler: { collect: false }
|
|
9
config/packages/translation.php
Normal file
9
config/packages/translation.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', ['default_locale' => 'en', 'translator' => ['default_path' => '%kernel.project_dir%/translations', 'fallbacks' => ['%locale%']]]);
|
||||||
|
};
|
@ -1,6 +0,0 @@
|
|||||||
framework:
|
|
||||||
default_locale: 'en'
|
|
||||||
translator:
|
|
||||||
default_path: '%kernel.project_dir%/translations'
|
|
||||||
fallbacks:
|
|
||||||
- '%locale%'
|
|
9
config/packages/twig.php
Normal file
9
config/packages/twig.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('twig', ['form_themes' => ['form_custom_layout.html.twig'], 'paths' => ['%kernel.project_dir%/templates'], 'debug' => '%kernel.debug%', 'strict_variables' => '%kernel.debug%', 'exception_controller' => null]);
|
||||||
|
};
|
@ -1,6 +0,0 @@
|
|||||||
twig:
|
|
||||||
form_themes: ['form_custom_layout.html.twig']
|
|
||||||
paths: ['%kernel.project_dir%/templates']
|
|
||||||
debug: '%kernel.debug%'
|
|
||||||
strict_variables: '%kernel.debug%'
|
|
||||||
exception_controller: null
|
|
9
config/packages/validator.php
Normal file
9
config/packages/validator.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', ['validation' => ['email_validation_mode' => 'html5']]);
|
||||||
|
};
|
@ -1,8 +0,0 @@
|
|||||||
framework:
|
|
||||||
validation:
|
|
||||||
email_validation_mode: html5
|
|
||||||
|
|
||||||
# Enables validator auto-mapping support.
|
|
||||||
# For instance, basic validation constraints will be inferred from Doctrine's metadata.
|
|
||||||
#auto_mapping:
|
|
||||||
# App\Entity\: []
|
|
11
config/routes.php
Normal file
11
config/routes.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
|
|
||||||
|
return function (RoutingConfigurator $routes) {
|
||||||
|
|
||||||
|
// if the action is implemented as the __invoke() method of the
|
||||||
|
// controller class, you can skip the 'method_name' part:
|
||||||
|
// ->controller(BlogController::class)
|
||||||
|
;
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
#index:
|
|
||||||
# path: /
|
|
||||||
# controller: App\Controller\DefaultController::index
|
|
7
config/routes/annotations.php
Normal file
7
config/routes/annotations.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
|
|
||||||
|
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||||
|
$routingConfigurator->import('../../src/Controller/', 'annotation');
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
controllers:
|
|
||||||
resource: '../../src/Controller/'
|
|
||||||
type: annotation
|
|
8
config/routes/dev/framework.php
Normal file
8
config/routes/dev/framework.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
|
|
||||||
|
return static function (RoutingConfigurator $routingConfigurator): void {
|
||||||
|
$routingConfigurator->import('@FrameworkBundle/Resources/config/routing/errors.xml')
|
||||||
|
->prefix('/_error');
|
||||||
|
};
|
@ -1,3 +0,0 @@
|
|||||||
_errors:
|
|
||||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
|
||||||
prefix: /_error
|
|
@ -1,3 +0,0 @@
|
|||||||
#_errors:
|
|
||||||
# resource: '@TwigBundle/Resources/config/routing/errors.xml'
|
|
||||||
# prefix: /_error
|
|
11
config/routes/dev/web_profiler.php
Normal file
11
config/routes/dev/web_profiler.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 {
|
||||||
|
$routingConfigurator->import('@WebProfilerBundle/Resources/config/routing/wdt.xml')
|
||||||
|
->prefix('/_wdt');
|
||||||
|
|
||||||
|
$routingConfigurator->import('@WebProfilerBundle/Resources/config/routing/profiler.xml')
|
||||||
|
->prefix('/_profiler');
|
||||||
|
};
|
@ -1,7 +0,0 @@
|
|||||||
web_profiler_wdt:
|
|
||||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
|
||||||
prefix: /_wdt
|
|
||||||
|
|
||||||
web_profiler_profiler:
|
|
||||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
|
||||||
prefix: /_profiler
|
|
37
config/services.php
Normal file
37
config/services.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||||
|
|
||||||
|
use App\Maker\MakeCollectionCrud;
|
||||||
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
|
return function (ContainerConfigurator $configurator): void {
|
||||||
|
$parameters = $configurator->parameters();
|
||||||
|
$parameters->set('locale', 'en');
|
||||||
|
|
||||||
|
// 'private' means you cannot fetch services directly from the container via $container->get()
|
||||||
|
// if you need to do this, you can override this setting on individual services
|
||||||
|
$services = $configurator->services()
|
||||||
|
->defaults()
|
||||||
|
->autowire()
|
||||||
|
->autoconfigure()
|
||||||
|
->private();
|
||||||
|
|
||||||
|
// makes classes in src/App available to be used as services
|
||||||
|
// this creates a service per class whose id is the fully-qualified class name
|
||||||
|
// you can exclude directories or files
|
||||||
|
// but if a service is unused, it's removed anyway
|
||||||
|
$services->load('App\\', '../src/*')
|
||||||
|
->exclude('../src/{Entity,Repository,Tests}');
|
||||||
|
|
||||||
|
// controllers are imported separately to make sure they're public
|
||||||
|
// and have a tag that allows actions to type-hint services
|
||||||
|
$services->load('App\\Controller\\', '../src/Controller')
|
||||||
|
->tag('controller.service_arguments');
|
||||||
|
|
||||||
|
// Fix wiring of custom CRUD maker class
|
||||||
|
$services->set(MakeCollectionCrud::class)
|
||||||
|
->arg('$doctrineHelper', '@maker.doctrine_helper')
|
||||||
|
->arg('$formTypeRenderer', '@maker.renderer.form_type_renderer');
|
||||||
|
|
||||||
|
};
|
@ -1,39 +0,0 @@
|
|||||||
# Learn more about services, parameters and containers at
|
|
||||||
# https://symfony.com/doc/current/service_container.html
|
|
||||||
parameters:
|
|
||||||
locale: en
|
|
||||||
|
|
||||||
services:
|
|
||||||
# default configuration for services in *this* file
|
|
||||||
_defaults:
|
|
||||||
# automatically injects dependencies in your services
|
|
||||||
autowire: true
|
|
||||||
# automatically registers your services as commands, event subscribers, etc.
|
|
||||||
autoconfigure: true
|
|
||||||
# this means you cannot fetch services directly from the container via $container->get()
|
|
||||||
# if you need to do this, you can override this setting on individual services
|
|
||||||
public: false
|
|
||||||
|
|
||||||
# makes classes in src/App available to be used as services
|
|
||||||
# this creates a service per class whose id is the fully-qualified class name
|
|
||||||
App\:
|
|
||||||
resource: '../src/*'
|
|
||||||
# you can exclude directories or files
|
|
||||||
# but if a service is unused, it's removed anyway
|
|
||||||
exclude: '../src/{Entity,Repository,Tests}'
|
|
||||||
|
|
||||||
# controllers are imported separately to make sure they're public
|
|
||||||
# and have a tag that allows actions to type-hint services
|
|
||||||
App\Controller\:
|
|
||||||
resource: '../src/Controller'
|
|
||||||
tags: ['controller.service_arguments']
|
|
||||||
|
|
||||||
# add more services, or override services that need manual wiring
|
|
||||||
# App\Service\ExampleService:
|
|
||||||
# arguments:
|
|
||||||
# $someArgument: 'some_value'
|
|
||||||
|
|
||||||
App\Maker\MakeCollectionCrud:
|
|
||||||
arguments:
|
|
||||||
'$doctrineHelper': '@maker.doctrine_helper'
|
|
||||||
'$formTypeRenderer': '@maker.renderer.form_type_renderer'
|
|
@ -12,6 +12,8 @@
|
|||||||
namespace App;
|
namespace App;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
|
||||||
|
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
|
||||||
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
|
||||||
@ -20,18 +22,28 @@ class Kernel extends BaseKernel
|
|||||||
{
|
{
|
||||||
use MicroKernelTrait;
|
use MicroKernelTrait;
|
||||||
|
|
||||||
protected function configureContainer(ContainerConfigurator $container): void
|
protected function configureContainer(
|
||||||
|
ContainerConfigurator $container,
|
||||||
|
LoaderInterface $loader,
|
||||||
|
ContainerBuilder $builder
|
||||||
|
): void
|
||||||
{
|
{
|
||||||
|
$configDir = $this->getConfigDir();
|
||||||
|
|
||||||
$container->import('../config/{packages}/*.yaml');
|
$container->import('../config/{packages}/*.yaml');
|
||||||
$container->import('../config/{packages}/' . $this->environment . '/*.yaml');
|
$container->import('../config/{packages}/' . $this->environment . '/*.yaml');
|
||||||
$container->import('../config/{services}.yaml');
|
|
||||||
$container->import('../config/{services}_' . $this->environment . '.yaml');
|
$container->import('../config/{packages}/*.php');
|
||||||
|
$container->import('../config/{packages}/' . $this->environment . '/*.php');
|
||||||
|
|
||||||
|
$container->import('../config/{services}.php');
|
||||||
|
$container->import('../config/{services}_' . $this->environment . '.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureRoutes(RoutingConfigurator $routes): void
|
protected function configureRoutes(RoutingConfigurator $routes): void
|
||||||
{
|
{
|
||||||
$routes->import('../config/{routes}/' . $this->environment . '/*.yaml');
|
$routes->import('../config/{routes}/' . $this->environment . '/*.php');
|
||||||
$routes->import('../config/{routes}/*.yaml');
|
$routes->import('../config/{routes}/*.php');
|
||||||
$routes->import('../config/{routes}.yaml');
|
$routes->import('../config/{routes}.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user