Skip to content

Commit a5adc30

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: 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 f5b9fcd + 819495c commit a5adc30

File tree

9 files changed

+44
-15
lines changed

9 files changed

+44
-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
@@ -444,14 +444,14 @@ read any flash messages from the session:
444444
<!-- app/Resources/views/base.html.php -->
445445

446446
// you can read and display just one flash message type...
447-
<?php foreach ($view['session']->getFlash('notice') as $message): ?>
447+
<?php foreach ($view['session']->getFlashBag()->get('notice') as $message): ?>
448448
<div class="flash-notice">
449449
<?php echo $message ?>
450450
</div>
451451
<?php endforeach ?>
452452

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

doctrine.rst

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

663663
.. tip::
664664

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

668-
.. image:: /_images/doctrine/web_debug_toolbar.png
669+
.. image:: /_images/doctrine/doctrine_web_debug_toolbar.png
669670
:align: center
670-
:scale: 50
671-
:width: 350
671+
:class: with-browser
672672

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

679677
Updating an Object
680678
~~~~~~~~~~~~~~~~~~

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

+4-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.3.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
.. caution::
@@ -57,3 +57,5 @@ you need to have the PDO driver installed for the database server you want
5757
to use.
5858

5959
.. _`Requirements section of the README`: https://github.com/symfony/symfony/blob/2.8/README.md#requirements
60+
.. _`JSON extension`: https://php.net/manual/book.json.php
61+
.. _`ctype extension`: https://php.net/manual/book.ctype.php

0 commit comments

Comments
 (0)