Skip to content

Commit 66e02f4

Browse files
committed
minor symfony#10371 [Configuration] Change the configuration to match framework.yaml/php (royklutman)
This PR was squashed before being merged into the 4.1 branch (closes symfony#10371). Discussion ---------- [Configuration] Change the configuration to match framework.yaml/php The current configuration in the docs is not the same as the actual configuration file. Actual configuration: https://github.com/symfony/recipes/blob/master/symfony/framework-bundle/3.3/config/packages/framework.yaml In the docs: https://symfony.com/doc/current/configuration.html#configuration-config-packages Commits ------- f909db3 [Configuration] Change the configuration to match framework.yaml/php
2 parents f9db2a5 + f909db3 commit 66e02f4

File tree

1 file changed

+70
-17
lines changed

1 file changed

+70
-17
lines changed

configuration.rst

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,34 @@ instance, the framework bundle is configured in ``config/packages/framework.yaml
2323
framework:
2424
secret: '%env(APP_SECRET)%'
2525
#default_locale: en
26-
#csrf_protection: ~
26+
#csrf_protection: true
2727
#http_method_override: true
28-
#trusted_hosts: ~
29-
# https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
30-
#session:
31-
# # The native PHP session handler will be used
32-
# handler_id: ~
33-
#esi: ~
34-
#fragments: ~
28+
29+
# Enables session support. Note that the session will ONLY be started if you read or write from it.
30+
# Remove or comment this section to explicitly disable session support.
31+
session:
32+
handler_id: ~
33+
34+
#esi: true
35+
#fragments: true
3536
php_errors:
3637
log: true
3738
39+
cache:
40+
# Put the unique name of your app here: the prefix seed
41+
# is used to compute stable namespaces for cache keys.
42+
#prefix_seed: your_vendor_name/app_name
43+
44+
# The app cache caches to the filesystem by default.
45+
# Other options include:
46+
47+
# Redis
48+
#app: cache.adapter.redis
49+
#default_redis_provider: redis://localhost
50+
51+
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
52+
#app: cache.adapter.apcu
53+
3854
.. code-block:: xml
3955
4056
<!-- config/packages/framework.xml -->
@@ -46,6 +62,30 @@ instance, the framework bundle is configured in ``config/packages/framework.yaml
4662
http://symfony.com/schema/dic/framework http://symfony.com/schema/dic/framework/framework-1.0.xsd"
4763
>
4864
<framework:config secret="%env(APP_SECRET)%">
65+
<!--<framework:csrf-protection enabled="true“ />-->
66+
<!--<framework:esi enabled="true" />-->
67+
<!--<framework:fragments enabled="true" />-->
68+
69+
<!-- Enables session support. Note that the session will ONLY be started if you read or write from it.
70+
Remove or comment this section to explicitly disable session support. -->
71+
<framework:session />
72+
73+
<!-- Put the unique name of your app here: the prefix seed
74+
is used to compute stable namespaces for cache keys.
75+
<framework:cache prefix-seed="your_vendor_name/app_name">
76+
-->
77+
<framework:cache>
78+
<!-- The app cache caches to the filesystem by default.
79+
Other options include: -->
80+
81+
<!-- Redis -->
82+
<!--<framework:app>cache.adapter.redis</framework:app>-->
83+
<!--<framework:default-redis-provider>redis://localhost</framework:default-redis-provider>-->
84+
85+
<!-- APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) -->
86+
<!--<framework:app>cache.adapter.apcu</framework:app>-->
87+
</framework:cache>
88+
4989
<framework:php-errors log="true" />
5090
</framework:config>
5191
</container>
@@ -56,19 +96,32 @@ instance, the framework bundle is configured in ``config/packages/framework.yaml
5696
$container->loadFromExtension('framework', [
5797
'secret' => '%env(APP_SECRET)%',
5898
//'default_locale' => 'en',
59-
//'csrf_protection' => null,
99+
//'csrf_protection' => true,
60100
//'http_method_override' => true,
61-
//'trusted_hosts' => null,
62-
// https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
63-
//'session' => [
64-
// // The native PHP session handler will be used
65-
// 'handler_id' => null,
66-
//],
67-
//'esi' => null,
68-
//'fragments' => null,
101+
102+
// Enables session support. Note that the session will ONLY be started if you read or write from it.
103+
// Remove or comment this section to explicitly disable session support.
104+
'session' => [
105+
'handler_id' => null,
106+
],
107+
//'esi' => true,
108+
//'fragments' => true,
69109
'php_errors' => [
70110
'log' => true,
71111
],
112+
'cache' => [
113+
//'prefix_seed' => 'your_vendor_name/app_name',
114+
115+
// The app cache caches to the filesystem by default.
116+
// Other options include:
117+
118+
// Redis
119+
//'app' => 'cache.adapter.redis',
120+
//'default_redis_provider: 'redis://localhost',
121+
122+
// APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
123+
//'app' => 'cache.adapter.apcu',
124+
],
72125
]);
73126
74127
The top-level key (here ``framework``) references configuration for a specific

0 commit comments

Comments
 (0)