Skip to content

Commit a22bfc4

Browse files
committed
Merge branch '4.1'
* 4.1: typo fix in speaker mentoring Wrap the entity namespace in single quotes Improved the article about session flashes add example for cache pool configuration Added link to bcrypt (Wikipedia) Added a caution note about the checkMX option clarify the datetime format option Update configuration.rst Update doctrine.rst Added `charset` "query string" Resolve T_STRING You do not need to re-add the command
2 parents f324a71 + 691c082 commit a22bfc4

File tree

10 files changed

+82
-51
lines changed

10 files changed

+82
-51
lines changed

configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ This is referenced inside ``config/packages/doctrine.yaml``:
227227
dbal:
228228
url: '%env(DATABASE_URL)%'
229229
230-
# the resolve: prefix will resolve parameters *inside* the env variable
230+
# The `resolve:` prefix replaces container params by their values inside the env variable:
231231
# url: '%env(resolve:DATABASE_URL)%'
232232
233233
For more details about environment variables, see :ref:`config-env-vars`.

console.rst

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,9 @@ console::
335335
{
336336
public function testExecute()
337337
{
338-
$kernel = self::bootKernel();
338+
$kernel = static::createKernel();
339339
$application = new Application($kernel);
340340

341-
$application->add(new CreateUserCommand());
342-
343341
$command = $application->find('app:create-user');
344342
$commandTester = new CommandTester($command);
345343
$commandTester->execute(array(
@@ -371,38 +369,6 @@ console::
371369
:class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`
372370
and extend the normal ``\PHPUnit\Framework\TestCase``.
373371

374-
To be able to use the fully set up service container for your console tests
375-
you can extend your test from
376-
:class:`Symfony\\Bundle\\FrameworkBundle\\Test\\KernelTestCase`::
377-
378-
// ...
379-
use Symfony\Component\Console\Tester\CommandTester;
380-
use Symfony\Bundle\FrameworkBundle\Console\Application;
381-
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
382-
383-
class CreateUserCommandTest extends KernelTestCase
384-
{
385-
public function testExecute()
386-
{
387-
$kernel = static::createKernel();
388-
$kernel->boot();
389-
390-
$application = new Application($kernel);
391-
392-
$command = $application->find('app:create-user');
393-
$commandTester = new CommandTester($command);
394-
$commandTester->execute(array(
395-
'command' => $command->getName(),
396-
'username' => 'Wouter',
397-
));
398-
399-
$output = $commandTester->getDisplay();
400-
$this->assertContains('Username: Wouter', $output);
401-
402-
// ...
403-
}
404-
}
405-
406372
Learn More
407373
----------
408374

contributing/community/speaker-mentoring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public speaker. They can even do practice runs via video chat!
3333
Furthermore, they can also be an ally when it comes to the day of
3434
giving the talk at a conference!
3535

36-
A great resource with advice on everything related to`public speaking`_
36+
A great resource with advice on everything related to `public speaking`_
3737
is a collection of links maintained by VM (Vicky) Brasseur. It covers
3838
everything from finding a conference call for proposals, how to
3939
refine a proposal, to how to put together slide decks to practical

doctrine.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ The database connection information is stored as an environment variable called
4949
5050
.. caution::
5151

52-
If the username, password or database name contain any character considered
53-
special in a URI (such as ``!``, ``@``, ``$``, ``#``), you must encode them.
52+
If the username, password, host or database name contain any character considered
53+
special in a URI (such as ``!``, ``@``, ``$``, ``#``, ``/``), you must encode them.
5454
See `RFC 3986`_ for the full list of reserved characters or use the
55-
:phpfunction:`urlencode` function to encode them.
55+
:phpfunction:`urlencode` function to encode them. In this case you need to remove
56+
the ``resolve:`` prefix in ``config/packages/doctrine.yaml`` to avoid errors:
57+
``url: '%env(resolve:DATABASE_URL)%'``
5658

5759
Now that your connection parameters are setup, Doctrine can create the ``db_name``
5860
database for you:

doctrine/registration_form.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ encoder in the security configuration:
324324
),
325325
));
326326
327-
In this case the recommended ``bcrypt`` algorithm is used. If needed, check out
327+
In this case the recommended `bcrypt`_ algorithm is used. If needed, check out
328328
the :ref:`user password encoding <security-encoding-user-password>` article.
329329

330330
Next, create the template:
@@ -422,3 +422,4 @@ us to add validation, even though there is no ``termsAccepted`` property on ``Us
422422

423423
.. _`CVE-2013-5750`: https://symfony.com/blog/cve-2013-5750-security-issue-in-fosuserbundle-login-form
424424
.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle
425+
.. _`bcrypt`: https://en.wikipedia.org/wiki/Bcrypt

doctrine/reverse_engineering.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ table fields.
5656

5757
.. code-block:: terminal
5858
59-
$ php bin/console doctrine:mapping:import App\\Entity annotation --path=src/Entity
59+
$ php bin/console doctrine:mapping:import 'App\Entity' annotation --path=src/Entity
6060
6161
This command line tool asks Doctrine to introspect the database and generate
6262
new PHP classes with annotation metadata into ``src/Entity``. This generates two
@@ -68,7 +68,7 @@ files: ``BlogPost.php`` and ``BlogComment.php``.
6868

6969
.. code-block:: terminal
7070
71-
$ php bin/console doctrine:mapping:import App\\Entity xml --path=config/doctrine
71+
$ php bin/console doctrine:mapping:import 'App\Entity' xml --path=config/doctrine
7272
7373
Generating the Getters & Setters or PHP Classes
7474
-----------------------------------------------

reference/configuration/framework.rst

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,57 @@ A list of cache pools to be created by the framework extension.
19551955

19561956
For more information about how pools works, see :ref:`cache pools <component-cache-cache-pools>`.
19571957

1958+
To configure a Redis cache pool with a default lifetime of 1 hour, do the following:
1959+
1960+
.. configuration-block::
1961+
1962+
.. code-block:: yaml
1963+
1964+
# config/packages/framework.yaml
1965+
framework:
1966+
cache:
1967+
pools:
1968+
cache.mycache:
1969+
adapter: cache.adapter.redis
1970+
default_lifetime: 3600
1971+
1972+
.. code-block:: xml
1973+
1974+
<!-- config/packages/framework.xml -->
1975+
<?xml version="1.0" encoding="UTF-8" ?>
1976+
<container xmlns="http://symfony.com/schema/dic/services"
1977+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1978+
xmlns:framework="http://symfony.com/schema/dic/symfony"
1979+
xsi:schemaLocation="http://symfony.com/schema/dic/services
1980+
http://symfony.com/schema/dic/services/services-1.0.xsd
1981+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
1982+
1983+
<framework:config>
1984+
<framework:cache>
1985+
<framework:pool
1986+
name="cache.mycache"
1987+
adapter="cache.adapter.redis"
1988+
default-lifetime=3600
1989+
/>
1990+
</framework:cache>
1991+
<!-- ... -->
1992+
</framework:config>
1993+
</container>
1994+
1995+
.. code-block:: php
1996+
1997+
// config/packages/framework.php
1998+
$container->loadFromExtension('framework', array(
1999+
'cache' => array(
2000+
'pools' => array(
2001+
'cache.mycache' => array(
2002+
'adapter' => 'cache.adapter.redis',
2003+
'default_lifetime' => 3600,
2004+
),
2005+
),
2006+
),
2007+
));
2008+
19582009
.. _reference-cache-pools-name:
19592010

19602011
name
@@ -1973,7 +2024,10 @@ adapter
19732024

19742025
**type**: ``string`` **default**: ``cache.app``
19752026

1976-
The name of the adapter to use. You could also use your own implementation.
2027+
The service name of the adapter to use. You can specify one of the default
2028+
services that follow the pattern ``cache.adapter.[type]``. Alternatively you
2029+
can specify another cache pool as base, which will make this pool inherit the
2030+
settings from the base pool as defaults.
19772031

19782032
.. note::
19792033

@@ -2009,7 +2063,10 @@ provider
20092063

20102064
**type**: ``string``
20112065

2012-
The service name to use as provider when the specified adapter needs one.
2066+
Overwrite the default service name or DSN respectively, if you do not want to
2067+
use what is configured as ``default_X_provider`` under ``cache``. See the
2068+
description of the default provider setting above for the type of adapter
2069+
you use for information on how to specify the provider.
20132070

20142071
clearer
20152072
"""""""

reference/constraints/Email.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ checkMX
137137
If true, then the :phpfunction:`checkdnsrr` PHP function will be used to
138138
check the validity of the MX record of the host of the given email.
139139

140+
.. caution::
141+
142+
This option is not reliable because it depends on the network conditions
143+
and some valid servers refuse to respond to those requests.
144+
140145
checkHost
141146
~~~~~~~~~
142147

reference/forms/types/datetime.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ format
127127

128128
If the ``widget`` option is set to ``single_text``, this option specifies
129129
the format of the input, i.e. how Symfony will interpret the given input
130-
as a datetime string. It defaults to the `RFC 3339`_ format which is used
131-
by the HTML5 ``datetime`` field. Keeping the default value will cause the
132-
field to be rendered as an ``input`` field with ``type="datetime"``. For
133-
more information on valid formats, see `Date/Time Format Syntax`_.
130+
as a datetime string. It defaults to the `datetime local`_ format which is
131+
used by the HTML5 ``datetime-local`` field. Keeping the default value will
132+
cause the field to be rendered as an ``input`` field with ``type="datetime-local"``.
133+
For more information on valid formats, see `Date/Time Format Syntax`_.
134134

135135
.. include:: /reference/forms/types/options/hours.rst.inc
136136

@@ -254,5 +254,5 @@ Field Variables
254254
| | | contains the input type to use (``datetime``, ``date`` or ``time``). |
255255
+----------+------------+----------------------------------------------------------------------+
256256

257-
.. _`RFC 3339`: https://tools.ietf.org/html/rfc3339
257+
.. _`datetime local`: http://w3c.github.io/html-reference/datatypes.html#form.data.datetime-local
258258
.. _`Date/Time Format Syntax`: http://userguide.icu-project.org/formatparse/datetime#TOC-Date-Time-Format-Syntax

session/avoid_session_start.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ access the flash messages:
2929

3030
.. code-block:: html+twig
3131

32-
{% if app.request.hasPreviousSession %}
32+
{% if app.request.method == 'POST' %}
3333
{% for message in app.flashes('notice') %}
3434
<div class="flash-notice">
3535
{{ message }}

0 commit comments

Comments
 (0)