new: dev: upgrade to the latest symfony v4 #3
This commit is contained in:
26
config/bundles.php
Normal file
26
config/bundles.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Sonata\DatagridBundle\SonataDatagridBundle::class => ['all' => true],
|
||||
Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true],
|
||||
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
|
||||
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
|
||||
Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true],
|
||||
Sonata\EasyExtendsBundle\SonataEasyExtendsBundle::class => ['all' => true],
|
||||
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
|
||||
Sonata\UserBundle\SonataUserBundle::class => ['all' => true],
|
||||
Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true],
|
||||
Gos\Bundle\PubSubRouterBundle\GosPubSubRouterBundle::class => ['all' => true],
|
||||
Gos\Bundle\WebSocketBundle\GosWebSocketBundle::class => ['all' => true],
|
||||
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
|
||||
];
|
||||
3
config/packages/assets.yaml
Normal file
3
config/packages/assets.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
assets:
|
||||
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
|
||||
19
config/packages/dev/monolog.yaml
Normal file
19
config/packages/dev/monolog.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
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"]
|
||||
3
config/packages/dev/routing.yaml
Normal file
3
config/packages/dev/routing.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: true
|
||||
6
config/packages/dev/web_profiler.yaml
Normal file
6
config/packages/dev/web_profiler.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
web_profiler:
|
||||
toolbar: true
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { only_exceptions: false }
|
||||
33
config/packages/doctrine.yaml
Normal file
33
config/packages/doctrine.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
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_mysql'
|
||||
server_version: '5.7'
|
||||
charset: utf8mb4
|
||||
default_table_options:
|
||||
charset: utf8mb4
|
||||
collate: utf8mb4_unicode_ci
|
||||
|
||||
url: '%env(resolve:DATABASE_URL)%'
|
||||
types:
|
||||
json: Sonata\Doctrine\Types\JsonType
|
||||
orm:
|
||||
auto_generate_proxy_classes: '%kernel.debug%'
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||
auto_mapping: true
|
||||
mappings:
|
||||
App:
|
||||
is_bundle: false
|
||||
type: annotation
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
SonataUserBundle: ~
|
||||
FOSUserBundle: ~
|
||||
5
config/packages/doctrine_migrations.yaml
Normal file
5
config/packages/doctrine_migrations.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
doctrine_migrations:
|
||||
dir_name: '%kernel.project_dir%/src/Migrations'
|
||||
# namespace is arbitrary but should be different from App\Migrations
|
||||
# as migrations classes should NOT be autoloaded
|
||||
namespace: DoctrineMigrations
|
||||
13
config/packages/fos_user.yaml
Normal file
13
config/packages/fos_user.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
fos_user:
|
||||
db_driver: orm # can be orm or odm
|
||||
firewall_name: main
|
||||
user_class: Sonata\UserBundle\Entity\BaseUser
|
||||
group:
|
||||
group_class: Sonata\UserBundle\Entity\BaseGroup
|
||||
group_manager: sonata.user.orm.group_manager # If you're using doctrine orm (use sonata.user.mongodb.group_manager for mongodb)
|
||||
service:
|
||||
user_manager: sonata.user.orm.user_manager
|
||||
mailer: 'fos_user.mailer.noop'
|
||||
from_email:
|
||||
address: '%env(MAILER_USER_ADDRESS)%'
|
||||
sender_name: '%env(MAILER_USER_NAME)%'
|
||||
32
config/packages/framework.yaml
Normal file
32
config/packages/framework.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
framework:
|
||||
secret: '%env(APP_SECRET)%'
|
||||
#default_locale: en
|
||||
#csrf_protection: true
|
||||
#http_method_override: true
|
||||
templating:
|
||||
engines: ['twig']
|
||||
|
||||
# Enables session support. Note that the session will ONLY be started if you read or write from it.
|
||||
# Remove or comment this section to explicitly disable session support.
|
||||
session:
|
||||
handler_id: ~
|
||||
|
||||
#esi: true
|
||||
#fragments: true
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
cache:
|
||||
# Put the unique name of your app here: the prefix seed
|
||||
# is used to compute stable namespaces for cache keys.
|
||||
#prefix_seed: your_vendor_name/app_name
|
||||
|
||||
# The app cache caches to the filesystem by default.
|
||||
# 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
|
||||
4
config/packages/gos_web_socket.yaml
Normal file
4
config/packages/gos_web_socket.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
gos_web_socket:
|
||||
server:
|
||||
port: 8080 #The port the socket server will listen on
|
||||
host: 127.0.0.1 #The host ip to bind to
|
||||
3
config/packages/mailer.yaml
Normal file
3
config/packages/mailer.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
mailer:
|
||||
dsn: '%env(MAILER_DSN)%'
|
||||
31
config/packages/prod/doctrine.yaml
Normal file
31
config/packages/prod/doctrine.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
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
|
||||
23
config/packages/prod/monolog.yaml
Normal file
23
config/packages/prod/monolog.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
excluded_http_codes: [404, 405]
|
||||
nested:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: ["!event", "!doctrine"]
|
||||
deprecation:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
|
||||
deprecation_filter:
|
||||
type: filter
|
||||
handler: deprecation
|
||||
max_level: info
|
||||
channels: ["php"]
|
||||
4
config/packages/prod/webpack_encore.yaml
Normal file
4
config/packages/prod/webpack_encore.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
#webpack_encore:
|
||||
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
|
||||
# Available in version 1.2
|
||||
#cache: true
|
||||
3
config/packages/routing.yaml
Normal file
3
config/packages/routing.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
router:
|
||||
strict_requirements: ~
|
||||
24
config/packages/security.yaml
Normal file
24
config/packages/security.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
security:
|
||||
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
|
||||
providers:
|
||||
in_memory: { memory: ~ }
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
main:
|
||||
anonymous: true
|
||||
|
||||
# activate different ways to authenticate
|
||||
|
||||
# http_basic: true
|
||||
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
|
||||
|
||||
# form_login: true
|
||||
# https://symfony.com/doc/current/security/form_login_setup.html
|
||||
|
||||
# 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 }
|
||||
3
config/packages/sensio_framework_extra.yaml
Normal file
3
config/packages/sensio_framework_extra.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
sensio_framework_extra:
|
||||
router:
|
||||
annotations: false
|
||||
10
config/packages/sonata_admin.yaml
Normal file
10
config/packages/sonata_admin.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
sonata_admin:
|
||||
title: 'Sonata Admin'
|
||||
dashboard:
|
||||
blocks:
|
||||
- { type: sonata.admin.block.admin_list, position: left }
|
||||
|
||||
sonata_block:
|
||||
blocks:
|
||||
sonata.admin.block.admin_list:
|
||||
contexts: [admin]
|
||||
4
config/packages/sonata_core.yaml
Normal file
4
config/packages/sonata_core.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
sonata_core:
|
||||
form:
|
||||
mapping:
|
||||
enabled: false
|
||||
3
config/packages/sonata_user.yaml
Normal file
3
config/packages/sonata_user.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
sonata_user:
|
||||
security_acl: false
|
||||
manager_type: orm # can be orm or mongodb
|
||||
4
config/packages/test/framework.yaml
Normal file
4
config/packages/test/framework.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
framework:
|
||||
test: true
|
||||
session:
|
||||
storage_id: session.storage.mock_file
|
||||
7
config/packages/test/monolog.yaml
Normal file
7
config/packages/test/monolog.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: "%kernel.logs_dir%/%kernel.environment%.log"
|
||||
level: debug
|
||||
channels: ["!event"]
|
||||
6
config/packages/test/web_profiler.yaml
Normal file
6
config/packages/test/web_profiler.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
framework:
|
||||
profiler: { collect: false }
|
||||
7
config/packages/translation.yaml
Normal file
7
config/packages/translation.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
framework:
|
||||
default_locale: '%locale%'
|
||||
translator:
|
||||
paths:
|
||||
- '%kernel.project_dir%/translations'
|
||||
fallbacks:
|
||||
- '%locale%'
|
||||
4
config/packages/twig.yaml
Normal file
4
config/packages/twig.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
twig:
|
||||
paths: ['%kernel.project_dir%/templates']
|
||||
debug: '%kernel.debug%'
|
||||
strict_variables: '%kernel.debug%'
|
||||
10
config/packages/twig_extensions.yaml
Normal file
10
config/packages/twig_extensions.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
services:
|
||||
_defaults:
|
||||
public: false
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
#Twig\Extensions\ArrayExtension: ~
|
||||
#Twig\Extensions\DateExtension: ~
|
||||
#Twig\Extensions\IntlExtension: ~
|
||||
#Twig\Extensions\TextExtension: ~
|
||||
14
config/packages/webpack_encore.yaml
Normal file
14
config/packages/webpack_encore.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
webpack_encore:
|
||||
# The path where Encore is building the assets.
|
||||
# This should match Encore.setOutputPath() in webpack.config.js.
|
||||
output_path: '%kernel.project_dir%/public/build'
|
||||
# If multiple builds are defined (as shown below), you can disable the default build:
|
||||
# output_path: false
|
||||
|
||||
# if using Encore.enableIntegrityHashes() specify the crossorigin attribute value (default: false, or use 'anonymous' or 'use-credentials')
|
||||
# crossorigin: 'anonymous'
|
||||
|
||||
# Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes).
|
||||
# To enable caching for the production environment, creating a webpack_encore.yaml in the config/packages/prod directory with this value set to true
|
||||
# Available in version 1.2
|
||||
#cache: false
|
||||
3
config/routes.yaml
Normal file
3
config/routes.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
#index:
|
||||
# path: /
|
||||
# controller: App\Controller\DefaultController::index
|
||||
3
config/routes/annotations.yaml
Normal file
3
config/routes/annotations.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
controllers:
|
||||
resource: ../../src/Controller/
|
||||
type: annotation
|
||||
3
config/routes/dev/twig.yaml
Normal file
3
config/routes/dev/twig.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
_errors:
|
||||
resource: '@TwigBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
||||
7
config/routes/dev/web_profiler.yaml
Normal file
7
config/routes/dev/web_profiler.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
web_profiler_wdt:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||
prefix: /_wdt
|
||||
|
||||
web_profiler_profiler:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||
prefix: /_profiler
|
||||
8
config/routes/sonata_admin.yaml
Normal file
8
config/routes/sonata_admin.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
admin_area:
|
||||
resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
|
||||
prefix: /admin
|
||||
|
||||
_sonata_admin:
|
||||
resource: .
|
||||
type: sonata_admin
|
||||
prefix: /admin
|
||||
7
config/routes/sonata_user.yaml
Normal file
7
config/routes/sonata_user.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
sonata_user_admin_security:
|
||||
resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
|
||||
prefix: /admin
|
||||
|
||||
sonata_user_admin_resetting:
|
||||
resource: '@SonataUserBundle/Resources/config/routing/admin_resetting.xml'
|
||||
prefix: /admin/resetting
|
||||
28
config/services.yaml
Normal file
28
config/services.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
parameters:
|
||||
locale: 'en'
|
||||
|
||||
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.
|
||||
public: false # Allows optimizing the container by removing unused services; this also means
|
||||
# fetching services directly from the container via $container->get() won't work.
|
||||
# The best practice is to be explicit about your dependencies anyway.
|
||||
|
||||
# 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/*'
|
||||
exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'
|
||||
|
||||
# controllers are imported separately to make sure services can be injected
|
||||
# as action arguments even if you don't extend any base controller class
|
||||
App\Controller\:
|
||||
resource: '../src/Controller'
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
Reference in New Issue
Block a user