Skip to content

Commit 9435c92

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: Minor rewords Update session_configuration.rst [symfony#7522] minor wording improvement Improved the image for Doctrine + Web Debug Toolbar Update bundles/configuration.rst fix usage of the session flag bag API Add caution related to deprecate mail transport Use https URLs when possible [Requirements] Clarify what are JSON and ctype Proposed a minor reword Added information about injecting a logger to your service
2 parents 631c68b + a5adc30 commit 9435c92

File tree

9 files changed

+45
-15
lines changed

9 files changed

+45
-15
lines changed
49.9 KB
Loading
-43.1 KB
Binary file not shown.

bundles/configuration.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ bundle configuration would look like:
8383
<?xml version="1.0" ?>
8484
8585
<container xmlns="http://symfony.com/schema/dic/services"
86-
xmlns:acme-social="http://example.org/dic/schema/acme_social"
86+
xmlns:acme-social="http://example.org/schema/dic/acme_social"
8787
xsi:schemaLocation="http://symfony.com/schema/dic/services
8888
http://symfony.com/schema/dic/services/services-1.0.xsd">
8989

components/http_foundation/session_configuration.rst

+14
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,20 @@ the ``php.ini`` directive ``session.gc_maxlifetime``. The meaning in this contex
139139
that any stored session that was saved more than ``gc_maxlifetime`` ago should be
140140
deleted. This allows one to expire records based on idle time.
141141

142+
However, some operating systems do their own session handling and set the
143+
``session.gc_probability`` variable to ``0`` to stop PHP doing garbage
144+
collection. That's why Symfony now overwrites this value to ``1``.
145+
146+
If you wish to use the original value set in your ``php.ini``, add the following
147+
configuration:
148+
149+
.. code-block:: yaml
150+
151+
# config.yml
152+
framework:
153+
session:
154+
gc_probability: null
155+
142156
You can configure these settings by passing ``gc_probability``, ``gc_divisor``
143157
and ``gc_maxlifetime`` in an array to the constructor of
144158
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage`

controller.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,14 @@ read any flash messages from the session:
436436
<!-- app/Resources/views/base.html.php -->
437437

438438
// you can read and display just one flash message type...
439-
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
439+
<?php foreach ($view['session']->getFlashBag()->get('notice') as $message): ?>
440440
<div class="flash-notice">
441441
<?php echo $message ?>
442442
</div>
443443
<?php endforeach ?>
444444

445445
// ...or you can read and display every flash message available
446-
<?php foreach ($view['session']->getFlashes() as $type => $flash_messages): ?>
446+
<?php foreach ($view['session']->getFlashBag()->all() as $type => $flash_messages): ?>
447447
<?php foreach ($flash_messages as $flash_message): ?>
448448
<div class="flash-<?php echo $type ?>">
449449
<?php echo $message ?>

doctrine.rst

+8-10
Original file line numberDiff line numberDiff line change
@@ -707,19 +707,17 @@ to easily fetch objects based on multiple conditions::
707707

708708
.. tip::
709709

710-
When you render any page, you can see how many queries were made in the
711-
bottom right corner of the web debug toolbar.
710+
When rendering a page requires to make some database calls, the web debug
711+
toolbar at the bottom of the page displays the number of queries and the
712+
time it took to execute them:
712713

713-
.. image:: /_images/doctrine/web_debug_toolbar.png
714+
.. image:: /_images/doctrine/doctrine_web_debug_toolbar.png
714715
:align: center
715-
:scale: 50
716-
:width: 350
716+
:class: with-browser
717717

718-
If you click the icon, the profiler will open, showing you the exact
719-
queries that were made.
720-
721-
The icon will turn yellow if there were more than 50 queries on the
722-
page. This could indicate that something is not correct.
718+
If the number of database queries is too high, the icon will turn yellow to
719+
indicate that something may not be correct. Click on the icon to open the
720+
Symfony Profiler and see the exact queries that were executed.
723721

724722
Updating an Object
725723
~~~~~~~~~~~~~~~~~~

email.rst

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ The following configuration attributes are available:
8686
* ``delivery_addresses`` (an array of email addresses where to send ALL emails)
8787
* ``disable_delivery`` (set to true to disable delivery completely)
8888

89+
.. caution::
90+
91+
Starting from SwiftMailer 5.4.5, the ``mail`` transport is deprecated
92+
and will be removed in version 6. Consider using another transport like
93+
``smtp``, ``sendmail`` or ``gmail``.
94+
8995
Sending Emails
9096
--------------
9197

logging.rst

+9
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,15 @@ option of your handler to ``rotating_file``:
308308
),
309309
));
310310
311+
Using a Logger inside a Service
312+
-------------------------------
313+
314+
To use a logger in your own services, add the ``@logger`` service as an argument
315+
of those services. If you want to use a pre-configured logger which uses a
316+
specific channel (``app`` by default), use the ``monolog.logger`` tag with the
317+
``channel`` property as explained in the
318+
:ref:`Dependency Injection reference <dic_tags-monolog>`.
319+
311320
Adding extra Data to each Log (e.g. a unique request token)
312321
-----------------------------------------------------------
313322

reference/requirements.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Required
2222
--------
2323

2424
* PHP needs to be a minimum version of PHP 5.5.9
25-
* JSON needs to be enabled
26-
* ctype needs to be enabled
25+
* `JSON extension`_ needs to be enabled
26+
* `ctype extension`_ needs to be enabled
2727
* Your ``php.ini`` needs to have the ``date.timezone`` setting
2828

2929
Optional
@@ -50,3 +50,6 @@ Doctrine
5050
If you want to use Doctrine, you will need to have PDO installed. Additionally,
5151
you need to have the PDO driver installed for the database server you want
5252
to use.
53+
54+
.. _`JSON extension`: https://php.net/manual/book.json.php
55+
.. _`ctype extension`: https://php.net/manual/book.ctype.php

0 commit comments

Comments
 (0)