8000 --- · symfony/symfony-docs@3a49101 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a49101

Browse files
committed
---
yaml --- r: 73447 b: refs/heads/5.x c: 2e5f7f4 h: refs/heads/5.x i: 73445: ad4f961 73443: e8be31a 73439: 121d4d1
1 parent 91fd88f commit 3a49101

23 files changed

+386
-105
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ refs/heads/3.3: 93587037fef6a2f40e0cbdea41754e1e76255fe6
9292
refs/heads/weaverryan-patch-1: a52aee3dceba3357dd59558677811a2ff86d1357
9393
refs/heads/4.0: e887a8b5e5d102235545837506f1d4e883f051a5
9494
refs/heads/4.1: 67f3845bc17a81379c609af1944099706e5b429e
95-
refs/heads/5.x: 45d6b28fe370d4be1a6bb003f93655dff2d79d69
95+
refs/heads/5.x: 2e5f7f4b5157ad97c368fc90ac79d17d4affd8de

trunk/_build/redirection_map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,4 @@
427427
/contributing/community/other /contributing/community
428428
/profiler/storage /profiler
429429
/setup/composer /setup
430+
/security/security_checker /setup
Loading

trunk/components/lock.rst

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,21 @@ Locks are used to guarantee exclusive access to some shared resource. In
2424
Symfony applications, you can use locks for example to ensure that a command is
2525
not executed more than once at the same time (on the same or different servers).
2626

27-
Locks are created using a :class:`Symfony\\Component\\Lock\\Factory` class,
27+
Locks are created using a :class:`Symfony\\Component\\Lock\\LockFactory` class,
2828
which in turn requires another class to manage the storage of locks::
2929

30-
use Symfony\Component\Lock\Factory;
30+
use Symfony\Component\Lock\LockFactory;
3131
use Symfony\Component\Lock\Store\SemaphoreStore;
3232

3333
$store = new SemaphoreStore();
34-
$factory = new Factory($store);
34+
$factory = new LockFactory($store);
3535

36-
The lock is created by calling the :method:`Symfony\\Component\\Lock\\Factory::createLock`
36+
.. versionadded:: 4.4
37+
38+
The ``Symfony\Component\Lock\LockFactory`` class was introduced in Symfony
39+
4.4. In previous versions it was called ``Symfony\Component\Lock\Factory``.
40+
41+
The lock is created by calling the :method:`Symfony\\Component\\Lock\\LockFactory::createLock`
3742
method. Its first argument is an arbitrary string that represents the locked
3843
resource. Then, a call to the :method:`Symfony\\Component\\Lock\\LockInterface::acquire`
3944
method will try to acquire the lock::
@@ -56,7 +61,7 @@ method can be safely called repeatedly, even if the lock is already acquired.
5661
Unlike other implementations, the Lock Component distinguishes locks
5762
instances even when they are created for the same resource. If a lock has
5863
to be used by several services, they should share the same ``Lock`` instance
59-
returned by the ``Factory::createLock`` method.
64+
returned by the ``LockFactory::createLock`` method.
6065

6166
.. tip::
6267

@@ -77,13 +82,13 @@ until the lock is acquired.
7782
Some of the built-in ``Store`` classes support this feature. When they don't,
7883
they can be decorated with the ``RetryTillSaveStore`` class::
7984

80-
use Symfony\Component\Lock\Factory;
85+
use Symfony\Component\Lock\LockFactory;
8186
use Symfony\Component\Lock\Store\RedisStore;
8287
use Symfony\Component\Lock\Store\RetryTillSaveStore;
8388

8489
$store = new RedisStore(new \Predis\Client('tcp://localhost:6379'));
8590
$store = new RetryTillSaveStore($store);
86-
$factory = new Factory($store);
91+
$factory = new LockFactory($store);
8792

8893
$lock = $factory->createLock('notification-flush');
8994
$lock->acquire(true);
@@ -208,8 +213,10 @@ Available Stores
208213
----------------
209214

210215
Locks are created and managed in ``Stores``, which are classes that implement
211-
:class:`Symfony\\Component\\Lock\\StoreInterface`. The component includes the
212-
following built-in store types:
216+
:class:`Symfony\\Component\\Lock\\PersistStoreInterface` and, optionally,
217+
:class:`Symfony\\Component\\Lock\\BlockingStoreInterface`.
218+
219+
The component includes the following built-in store types:
213220

214221
============================================ ====== ======== ========
215222
Store Scope Blocking Expiring
@@ -222,6 +229,12 @@ Store Scope Blocking Expiring
222229
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no
223230
============================================ ====== ======== ========
224231

232+
.. versionadded:: 4.4
233+
234+
The ``PersistStoreInterface`` and ``BlockingStoreInterface`` interfaces were
235+
introduced in Symfony 4.4. In previous versions there was only one interface
236+
called ``Symfony\Component\Lock\StoreInterface``.
237+
225238
.. _lock-store-flock:
226239

227240
FlockStore

trunk/components/mime.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ MIME types and file name extensions::
254254
These methods return arrays with one or more elements. The element position
255255
indicates its priority, so the first returned extension is the preferred one.
256256

257+
.. _components-mime-type-guess:
258+
257259
Guessing the MIME Type
258260
~~~~~~~~~~~~~~~~~~~~~~
259261

trunk/components/phpunit_bridge.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ constraint to test the validity of the email domain::
521521
$result = $validator->validate('foo@example.com', $constraint);
522522

523523
// ...
524+
}
524525
}
525526

526527
In order to avoid making a real network connection, add the ``@dns-sensitive``
@@ -545,6 +546,7 @@ the data you expect to get for the given hosts::
545546
$result = $validator->validate('foo@example.com', $constraint);
546547

547548
// ...
549+
}
548550
}
549551

550552
The ``withMockedHosts()`` method configuration is defined as an array. The keys

trunk/components/property_info.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,9 @@ ReflectionExtractor
351351

352352
Using PHP reflection, the :class:`Symfony\\Component\\PropertyInfo\\Extractor\\ReflectionExtractor`
353353
provides list, type and access information from setter and accessor methods.
354-
It can also give the type of a property, and if it is initializable through the
355-
constructor. It supports return and scalar types for PHP 7::
354+
It can also give the type of a property (even extracting it from the constructor
355+
arguments), and if it is initializable through the constructor. It supports
356+
return and scalar types for PHP 7::
356357

357358
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
358359

@@ -371,6 +372,11 @@ constructor. It supports return and scalar types for PHP 7::
371372
// Initializable information
372373
$reflectionExtractor->isInitializable($class, $property);
373374

375+
.. versionadded:: 4.1
376+
377+
The feature to extract the property types from constructor arguments was
378+
introduced in Symfony 4.1.
379+
374380
.. note::
375381

376382
When using the Symfony framework, this service is automatically registered

trunk/components/var_dumper.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ option. Read more about this and other options in
224224
are supported (``Ctrl. + G`` or ``Cmd. + G``, ``F3``, etc.) When
225225
finished, press ``Esc.`` to hide the box again.
226226

227+
If you want to use your browser search input, press ``Ctrl. + F`` or
228+
``Cmd. + F`` again while having focus on VarDumper's search input.
229+
230+
.. versionadded:: 4.4
231+
232+
The feature to use the browser search input was introduced in Symfony 4.4.
233+
227234
Using the VarDumper Component in your PHPUnit Test Suite
228235
--------------------------------------------------------
229236

trunk/contributing/code/security.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ Security Advisories
169169
.. tip::
170170

171171
You can check your Symfony application for known security vulnerabilities
172-
using the ``security:check`` command (see :doc:`/security/security_checker`).
172+
using the ``security:check`` command provided by the
173+
:ref:`Symfony security checker <security-checker>`.
173174

174175
Check the `Security Advisories`_ blog category for a list of all security
175176
vulnerabilities that were fixed in Symfony releases, starting from Symfony

trunk/contributing/documentation/format.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ Symfony 5.0 were released today, 4.0 to 4.4 ``versionadded`` and ``deprecated``
210210
tags would be removed from the new ``5.0`` branch.
211211

212212
.. _reStructuredText: http://docutils.sourceforge.net/rst.html
213-
.. _Sphinx: http://sphinx-doc.org/
213+
.. _Sphinx: https://www.sphinx-doc.org/
214214
.. _`Symfony documentation`: https://github.com/symfony/symfony-docs
215-
.. _`reStructuredText Primer`: http://sphinx-doc.org/rest.html
215+
.. _`reStructuredText Primer`: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
216216
.. _`reStructuredText Reference`: http://docutils.sourceforge.net/docs/user/rst/quickref.html
217-
.. _`Sphinx Markup Constructs`: http://sphinx-doc.org/markup/
217+
.. _`Sphinx Markup Constructs`: https://www.sphinx-doc.org/en/1.7/markup/index.html
218218
.. _`supported languages`: http://pygments.org/languages/

trunk/event_dispatcher.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ The most common way to listen to an event is to register an **event listener**::
2727
namespace App\EventListener;
2828

2929
use Symfony\Component\HttpFoundation\Response;
30-
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
30+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
3131
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
3232

3333
class ExceptionListener
3434
{
35-
public function onKernelException(GetResponseForExceptionEvent $event)
35+
public function onKernelException(ExceptionEvent $event)
3636
{
3737
// You get the exception object from the received event
3838
$exception = $event->getException();
@@ -63,10 +63,16 @@ The most common way to listen to an event is to register an **event listener**::
6363
.. tip::
6464

6565
Each event receives a slightly different type of ``$event`` object. For
66-
the ``kernel.exception`` event, it is :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`.
66+
the ``kernel.exception`` event, it is :class:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent`.
6767
Check out the :doc:`Symfony events reference </reference/events>` to see
6868
what type of object each event provides.
6969

70+
.. versionadded::
71+
72+
The :class:`Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent` class was
73+
introduced in Symfony 4.3. In previous versions it was called
74+
``Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent``.
75+
7076
Now that the class is created, you need to register it as a service and
7177
notify Symfony that it is a "listener" on the ``kernel.exception`` event by
7278
using a special "tag":
@@ -151,7 +157,7 @@ listen to the same ``kernel.exception`` event::
151157
namespace App\EventSubscriber;
152158

153159
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
154-
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
160+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
155161
use Symfony\Component\HttpKernel\KernelEvents;
156162

157163
class ExceptionSubscriber implements EventSubscriberInterface
@@ -168,17 +174,17 @@ listen to the same ``kernel.exception`` event::
168174
];
169175
}
170176

171-
public function processException(GetResponseForExceptionEvent $event)
177+
public function processException(ExceptionEvent $event)
172178
{
173179
// ...
174180
}
175181

176-
public function logException(GetResponseForExceptionEvent $event)
182+
public function logException(ExceptionEvent $event)
177183
{
178184
// ...
179185
}
180186

181-
public function notifyException(GetResponseForExceptionEvent $event)
187+
public function notifyException(ExceptionEvent $event)
182188
{
183189
// ...
184190
}
@@ -207,11 +213,11 @@ or a "sub request"::
207213
// src/EventListener/RequestListener.php
208214
namespace App\EventListener;
209215

210-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
216+
use Symfony\Component\HttpKernel\Event\RequestEvent;
211217

212218
class RequestListener
213219
{
214-
public function onKernelRequest(GetResponseEvent $event)
220+
public function onKernelRequest(RequestEvent $event)
215221
{
216222
if (!$event->isMasterRequest()) {
217223
// don't do anything if it's not the master request

trunk/frontend.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ Other Front-End Articles
109109
.. _`Webpack`: https://webpack.js.org/
110110
.. _`Webpacker`: https://github.com/rails/webpacker
111111
.. _`Mix`: https://laravel.com/docs/mix
112-
.. _`Symfony`: http://symfony.com/
112+
.. _`Symfony`: https://symfony.com/
113113
.. _`Full API`: https://github.com/symfony/webpack-encore/blob/master/index.js
114114
.. _`Webpack Encore screencast series`: https://symfonycasts.com/screencast/webpack-encore

trunk/mercure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ to the Mercure Hub to be authorized to publish updates.
101101

102102
This JWT should be stored in the ``MERCURE_JWT_SECRET`` environment variable.
103103

104-
The JWT must be signed with the same secret key than the one used by
104+
The JWT must be signed with the same secret key as the one used by
105105
the Hub to verify the JWT (``aVerySecretKey`` in our example).
106106
Its payload must contain at least the following structure to be allowed to
107107
publish:

trunk/profiler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ which provides utilities to profile code and displays the results on the
9797

9898
When using :ref:`autowiring <services-autowire>`, type-hint any argument with
9999
the :class:`Symfony\\Component\\Stopwatch\\Stopwatch` class and Symfony will
100-
inject the Stopwatch service. Then, use the ``start()``, ``lapse()`` and
100+
inject the Stopwatch service. Then, use the ``start()``, ``lap()`` and
101101
``stop()`` methods to measure time::
102102

103103
// a user signs up and the timer starts...
104104
$stopwatch->start('user-sign-up');
105105

106106
// ...do things to sign up the user...
107-
$stopwatch->lapse('user-sign-up');
107+
$stopwatch->lap('user-sign-up');
108108

109109
// ...the sign up process is finished
110110
$stopwatch->stop('user-sign-up');

trunk/quick_tour/the_big_picture.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Symfony application:
4141
4242
Can we already load the project in a browser? Yes! You can setup
4343
:doc:`Nginx or Apache </setup/web_server_configuration>` and configure their
44-
document root to be the ``public/`` directory. But, for development, Symfony has
45-
its own server. Install and run it with:
44+
document root to be the ``public/`` directory. But, for development, it's better
45+
to :doc:`install the Symfony local web server </setup/symfony_server>` and run
46+
it as follows:
4647

4748
.. code-block:: terminal
4849
49-
$ composer require --dev server
50-
$ php bin/console server:start
50+
$ symfony server:start
5151
5252
Try your new app by going to ``http://localhost:8000`` in a browser!
5353

trunk/reference/configuration/doctrine.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ which is the first one defined or the one configured via the
157157
Each connection is also accessible via the ``doctrine.dbal.[name]_connection``
158158
service where ``[name]`` is the name of the connection.
159159

160-
.. _DBAL documentation: http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
160+
.. _DBAL documentation: https://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
161161

162162
Doctrine ORM Configuration
163163
--------------------------
@@ -436,4 +436,4 @@ If the ``dir`` configuration is set and the ``is_bundle`` configuration
436436
is ``true``, the DoctrineBundle will prefix the ``dir`` configuration with
437437
the path of the bundle.
438438

439-
.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html
439+
.. _`DQL User Defined Functions`: https://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html

trunk/reference/dic_tags.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Tag Name Usage
2626
`kernel.event_subscriber`_ To subscribe to a set of different events/hooks in Symfony
2727
`kernel.fragment_renderer`_ Add new HTTP content rendering strategies
2828
`kernel.reset`_ Allows to clean up services between requests
29+
`mime.mime_type_guesser`_ Add your own logic for guessing MIME types
2930
`monolog.logger`_ Logging with a custom logging channel
3031
`monolog.processor`_ Add a custom processor for logging
3132
`routing.loader`_ Register a custom service that loads routes
@@ -466,6 +467,21 @@ reuse the Symfony application between requests to improve performance. This tag
466467
is applied for example to the built-in :doc:`data collectors </profiler/data_collector>`
467468
of the profiler to delete all their information.
468469

470+
.. _dic_tags-mime:
471+
472+
mime.mime_type_guesser
473+
----------------------
474+
475+
**Purpose**: Add your own logic for guessing MIME types
476+
477+
This tag is used to register your own :ref:`MIME type guessers <components-mime-type-guess>`
478+
in case the guessers provided by the :doc:`Mime component </components/mime>`
479+
don't fit your needs.
480+
481+
.. versionadded:: 4.3
482+
483+
The ``mime.mime_type_guesser`` tag was introduced in Symfony 4.3.
484+
469485
.. _dic_tags-monolog:
470486

471487
monolog.logger

trunk/security.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,6 @@ For example, in a controller extending from the :ref:`base controller <the-base-
928928
:doc:`security voter </security/voters>` that looks for the user roles
929929
in the database.
930930

931-
Checking for Security Vulnerabilities in your Dependencies
932-
----------------------------------------------------------
933-
934-
See :doc:`/security/security_checker`.
935-
936931
Frequently Asked Questions
937932
--------------------------
938933

@@ -1005,7 +1000,6 @@ Authorization (Denying Access)
10051000
security/access_denied_handler
10061001
security/acl
10071002
security/force_https
1008-
security/security_checker
10091003

10101004
.. _`frameworkextrabundle documentation`: https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
10111005
.. _`HWIOAuthBundle`: https://github.com/hwi/HWIOAuthBundle

trunk/security/security_checker.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0