Skip to content

Commit cc234a0

Browse files
author
BSP
committed
Mise à jour 5.4 LTS
0 parents  commit cc234a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1690
-0
lines changed

.env

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
#
13+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
14+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
15+
16+
###> symfony/framework-bundle ###
17+
APP_ENV=dev
18+
APP_SECRET=d3b0e57536cd6b101df204a8555533e3
19+
###< symfony/framework-bundle ###
20+
21+
###> doctrine/doctrine-bundle ###
22+
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
23+
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
24+
#
25+
DATABASE_URL="sqlite:///%kernel.project_dir%/var/blog.db"
26+
# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
27+
# DATABASE_URL="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8"
28+
###< doctrine/doctrine-bundle ###

.gitignore

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# ---> Symfony
2+
# Cache and logs (Symfony2)
3+
/app/cache/*
4+
/app/logs/*
5+
!app/cache/.gitkeep
6+
!app/logs/.gitkeep
7+
8+
# Email spool folder
9+
/app/spool/*
10+
11+
# Cache, session files and logs (Symfony3)
12+
/var/cache/*
13+
/var/logs/*
14+
/var/sessions/*
15+
!var/cache/.gitkeep
16+
!var/logs/.gitkeep
17+
!var/sessions/.gitkeep
18+
19+
# Logs (Symfony4)
20+
/var/log/*
21+
!var/log/.gitkeep
22+
23+
# Parameters
24+
/app/config/parameters.yml
25+
/app/config/parameters.ini
26+
27+
# Managed by Composer
28+
/app/bootstrap.php.cache
29+
/var/bootstrap.php.cache
30+
/bin/*
31+
!bin/console
32+
!bin/symfony_requirements
33+
/vendor/
34+
35+
# Assets and user uploads
36+
/web/bundles/
37+
/web/uploads/
38+
39+
# PHPUnit
40+
/app/phpunit.xml
41+
/phpunit.xml
42+
43+
# Build data
44+
/build/
45+
46+
# Composer PHAR
47+
/composer.phar
48+
49+
# Backup entities generated with doctrine:generate:entities command
50+
**/Entity/*~
51+
52+
# Embedded web-server pid file
53+
/.web-server-pid
54+
55+
56+
###> symfony/framework-bundle ###
57+
/.env.local
58+
/.env.local.php
59+
/.env.*.local
60+
/config/secrets/prod/prod.decrypt.private.php
61+
/public/bundles/
62+
/var/
63+
/vendor/
64+
###< symfony/framework-bundle ###
65+
66+
###> symfony/phpunit-bridge ###
67+
.phpunit
68+
.phpunit.result.cache
69+
/phpunit.xml
70+
###< symfony/phpunit-bridge ###
71+
72+
#phpstorm
73+
.idea

bin/console

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
9+
}
10+
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
12+
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
15+
16+
return new Application($kernel);
17+
};

composer.json

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"type": "project",
3+
"license": "proprietary",
4+
"minimum-stability": "stable",
5+
"prefer-stable": true,
6+
"require": {
7+
"php": ">=7.2.5",
8+
"ext-ctype": "*",
9+
"ext-iconv": "*",
10+
"doctrine/doctrine-bundle": "^2.8",
11+
"doctrine/doctrine-fixtures-bundle": "^3.4",
12+
"doctrine/doctrine-migrations-bundle": "^3.2",
13+
"doctrine/orm": "^2.14",
14+
"sensio/framework-extra-bundle": "^6.2",
15+
"symfony/apache-pack": "^1.0",
16+
"symfony/asset": "5.4.*",
17+
"symfony/console": "5.4.*",
18+
"symfony/dotenv": "5.4.*",
19+
"symfony/flex": "^1.17|^2",
20+
"symfony/form": "5.4.*",
21+
"symfony/framework-bundle": "5.4.*",
22+
"symfony/maker-bundle": "^1.48",
23+
"symfony/proxy-manager-bridge": "5.4.*",
24+
"symfony/runtime": "5.4.*",
25+
"symfony/security-bundle": "5.4.*",
26+
"symfony/security-csrf": "5.4.*",
27+
"symfony/twig-bundle": "5.4.*",
28+
"symfony/validator": "5.4.*",
29+
"symfony/web-profiler-bundle": "5.4.*",
30+
"symfony/yaml": "5.4.*",
31+
"twig/extra-bundle": "^2.12|^3.0",
32+
"twig/twig": "^2.12|^3.0"
33+
},
34+
"config": {
35+
"allow-plugins": {
36+
"composer/package-versions-deprecated": true,
37+
"symfony/flex": true,
38+
"symfony/runtime": true
39+
},
40+
"optimize-autoloader": true,
41+
"preferred-install": {
42+
"*": "dist"
43+
},
44+
"sort-packages": true
45+
},
46+
"autoload": {
47+
"psr-4": {
48+
"App\\": "src/"
49+
}
50+
},
51+
"autoload-dev": {
52+
"psr-4": {
53+
"App\\Tests\\": "tests/"
54+
}
55+
},
56+
"replace": {
57+
"symfony/polyfill-ctype": "*",
58+
"symfony/polyfill-iconv": "*",
59+
"symfony/polyfill-php72": "*"
60+
},
61+
"scripts": {
62+
"auto-scripts": {
63+
"cache:clear": "symfony-cmd",
64+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
65+
},
66+
"post-install-cmd": [
67+
"@auto-scripts"
68+
],
69+
"post-update-cmd": [
70+
"@auto-scripts"
71+
]
72+
},
73+
"conflict": {
74+
"symfony/symfony": "*",
75+
"doctrine/orm": "2.12.0"
76+
},
77+
"extra": {
78+
"symfony": {
79+
"allow-contrib": false,
80+
"require": "5.4.*"
81+
}
82+
}
83+
}

config/bundles.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
return [
4+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
5+
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
6+
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
7+
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
8+
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
9+
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
10+
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
11+
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
12+
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
13+
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
14+
];

config/packages/cache.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
framework:
2+
cache:
3+
# Unique name of your app: used to compute stable namespaces for cache keys.
4+
#prefix_seed: your_vendor_name/app_name
5+
6+
# The "app" cache stores to the filesystem by default.
7+
# The data in this cache should persist between deploys.
8+
# Other options include:
9+
10+
# Redis
11+
#app: cache.adapter.redis
12+
#default_redis_provider: redis://localhost
13+
14+
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
15+
#app: cache.adapter.apcu
16+
17+
# Namespaced pools use the above "app" backend by default
18+
#pools:
19+
#my.dedicated.cache: null

config/packages/dev/web_profiler.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
web_profiler:
2+
toolbar: true
3+
intercept_redirects: false
4+
5+
framework:
6+
profiler: { only_exceptions: false }

config/packages/doctrine.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
doctrine:
2+
dbal:
3+
url: '%env(resolve:DATABASE_URL)%'
4+
5+
# IMPORTANT: You MUST configure your server version,
6+
# either here or in the DATABASE_URL env var (see .env file)
7+
#server_version: '13'
8+
orm:
9+
auto_generate_proxy_classes: true
10+
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
11+
auto_mapping: true
12+
mappings:
13+
App:
14+
is_bundle: false
15+
dir: '%kernel.project_dir%/src/Entity'
16+
prefix: 'App\Entity'
17+
alias: App
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
doctrine_migrations:
2+
migrations_paths:
3+
# namespace is arbitrary but should be different from App\Migrations
4+
# as migrations classes should NOT be autoloaded
5+
'DoctrineMigrations': '%kernel.project_dir%/migrations'
6+
enable_profiler: '%kernel.debug%'

config/packages/framework.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# see https://symfony.com/doc/current/reference/configuration/framework.html
2+
framework:
3+
secret: '%env(APP_SECRET)%'
4+
#csrf_protection: true
5+
http_method_override: false
6+
7+
# Enables session support. Note that the session will ONLY be started if you read or write from it.
8+
# Remove or comment this section to explicitly disable session support.
9+
session:
10+
handler_id: null
11+
cookie_secure: auto
12+
cookie_samesite: lax
13+
storage_factory_id: session.storage.factory.native
14+
15+
#esi: true
16+
#fragments: true
17+
php_errors:
18+
log: true
19+
20+
when@test:
21+
framework:
22+
test: true
23+
session:
24+
storage_factory_id: session.storage.factory.mock_file

config/packages/prod/doctrine.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
doctrine:
2+
orm:
3+
auto_generate_proxy_classes: false
4+
query_cache_driver:
5+
type: pool
6+
pool: doctrine.system_cache_pool
7+
result_cache_driver:
8+
type: pool
9+
pool: doctrine.result_cache_pool
10+
11+
framework:
12+
cache:
13+
pools:
14+
doctrine.result_cache_pool:
15+
adapter: cache.app
16+
doctrine.system_cache_pool:
17+
adapter: cache.system

config/packages/routing.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
framework:
2+
router:
3+
utf8: true
4+
5+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
6+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
7+
#default_uri: http://localhost
8+
9+
when@prod:
10+
framework:
11+
router:
12+
strict_requirements: null

config/packages/security.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
security:
2+
enable_authenticator_manager: true
3+
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
4+
password_hashers:
5+
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
6+
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
7+
providers:
8+
users_in_memory: { memory: null }
9+
firewalls:
10+
dev:
11+
pattern: ^/(_(profiler|wdt)|css|images|js)/
12+
security: false
13+
main:
14+
lazy: true
15+
provider: users_in_memory
16+
17+
# activate different ways to authenticate
18+
# https://symfony.com/doc/current/security.html#the-firewall
19+
20+
# https://symfony.com/doc/current/security/impersonating_user.html
21+
# switch_user: true
22+
23+
# Easy way to control access for large sections of your site
24+
# Note: Only the *first* access control that matches will be used
25+
access_control:
26+
# - { path: ^/admin, roles: ROLE_ADMIN }
27+
# - { path: ^/profile, roles: ROLE_USER }
28+
29+
when@test:
30+
security:
31+
password_hashers:
32+
# By default, password hashers are resource intensive and take time. This is
33+
# important to generate secure password hashes. In tests however, secure hashes
34+
# are not important, waste resources and increase test times. The following
35+
# reduces the work factor to the lowest possible values.
36+
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface:
37+
algorithm: auto
38+
cost: 4 # Lowest possible value for bcrypt
39+
time_cost: 3 # Lowest possible value for argon
40+
memory_cost: 10 # Lowest possible value for argon
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sensio_framework_extra:
2+
router:
3+
annotations: false

config/packages/test/doctrine.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
doctrine:
2+
dbal:
3+
# "TEST_TOKEN" is typically set by ParaTest
4+
dbname_suffix: '_test%env(default::TEST_TOKEN)%'

config/packages/test/validator.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
validation:
3+
not_compromised_password: false
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
web_profiler:
2+
toolbar: false
3+
intercept_redirects: false
4+
5+
framework:
6+
profiler: { collect: false }

config/packages/twig.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
twig:
2+
default_path: '%kernel.project_dir%/templates'
3+
4+
when@test:
5+
twig:
6+
strict_variables: true

0 commit comments

Comments
 (0)