8000 --- · githubfromgui/symfony-docs@91fd88f · GitHub
[go: up one dir, main page]

Skip to content

Commit 91fd88f

Browse files
committed
---
yaml --- r: 73446 b: refs/heads/5.x c: 45d6b28 h: refs/heads/5.x
1 parent ad4f961 commit 91fd88f

24 files changed

+156
-394
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: 8aa0cd4df8c4d75a1a40f4e4cbca86ea68f204dc
95+
refs/heads/5.x: 45d6b28fe370d4be1a6bb003f93655dff2d79d69

trunk/_build/redirection_map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,4 +427,3 @@
427427
/contributing/community/other /contributing/community
428428
/profiler/storage /profiler
429429
/setup/composer /setup
430-
/security/security_checker /setup
Binary file not shown.

trunk/components/lock.rst

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@ 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\\LockFactory` class,
27+
Locks are created using a :class:`Symfony\\Component\\Lock\\Factory` class,
2828
which in turn requires another class to manage the storage of locks::
2929

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

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

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`
36+
The lock is created by calling the :method:`Symfony\\Component\\Lock\\Factory::createLock`
4237
method. Its first argument is an arbitrary string that represents the locked
4338
resource. Then, a call to the :method:`Symfony\\Component\\Lock\\LockInterface::acquire`
4439
method will try to acquire the lock::
@@ -61,7 +56,7 @@ method can be safely called repeatedly, even if the lock is already acquired.
6156
Unlike other implementations, the Lock Component distinguishes locks
6257
instances even when they are created for the same resource. If a lock has
6358
to be used by several services, they should share the same ``Lock`` instance
64-
returned by the ``LockFactory::createLock`` method.
59+
returned by the ``Factory::createLock`` method.
6560

6661
.. tip::
6762

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

85-
use Symfony\Component\Lock\LockFactory;
80+
use Symfony\Component\Lock\Factory;
8681
use Symfony\Component\Lock\Store\RedisStore;
8782
use Symfony\Component\Lock\Store\RetryTillSaveStore;
8883

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

9388
$lock = $factory->createLock('notification-flush');
9489
$lock->acquire(true);
@@ -213,10 +208,8 @@ Available Stores
213208
----------------
214209

215210
Locks are created and managed in ``Stores``, which are classes that implement
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:
211+
:class:`Symfony\\Component\\Lock\\StoreInterface`. The component includes the
212+
following built-in store types:
220213

221214
============================================ ====== ======== ========
222215
Store Scope Blocking Expiring
@@ -229,12 +222,6 @@ Store Scope Blocking Expiring
229222
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no
230223
============================================ ====== ======== ========
231224

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-
238225
.. _lock-store-flock:
239226

240227
FlockStore

trunk/components/mime.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ 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-
259257
Guessing the MIME Type
260258
~~~~~~~~~~~~~~~~~~~~~~
261259

trunk/components/phpunit_bridge.rst

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

523523
// ...
524-
}
525524
}
526525

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

548547
// ...
549-
}
550548
}
551549

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

trunk/components/property_info.rst

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,8 @@ 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 (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::
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::
357356

358357
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
359358

@@ -372,11 +371,6 @@ return and scalar types for PHP 7::
372371
// Initializable information
373372
$reflectionExtractor->isInitializable($class, $property);
374373

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

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

trunk/components/var_dumper.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,6 @@ 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-
234227
Using the VarDumper Component in your PHPUnit Test Suite
235228
--------------------------------------------------------
236229

trunk/contributing/code/security.rst

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

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

175174
Check the `Security Advisories`_ blog category for a list of all security
176175
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: https://www.sphinx-doc.org/
213+
.. _Sphinx: http://sphinx-doc.org/
214214
.. _`Symfony documentation`: https://github.com/symfony/symfony-docs
215-
.. _`reStructuredText Primer`: https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
215+
.. _`reStructuredText Primer`: http://sphinx-doc.org/rest.html
216216
.. _`reStructuredText Reference`: http://docutils.sourceforge.net/docs/user/rst/quickref.html
217-
.. _`Sphinx Markup Constructs`: https://www.sphinx-doc.org/en/1.7/markup/index.html
217+
.. _`Sphinx Markup Constructs`: http://sphinx-doc.org/markup/
218218
.. _`supported languages`: http://pygments.org/languages/

trunk/event_dispatcher.rst

Lines changed: 9 additions & 15 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\ExceptionEvent;
30+
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
3131
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
3232

3333
class ExceptionListener
3434
{
35-
public function onKernelException(ExceptionEvent $event)
35+
public function onKernelException(GetResponseForExceptionEvent $event)
3636
{
3737
// You get the exception object from the received event
3838
$exception = $event->getException();
@@ -63,16 +63,10 @@ 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\\ExceptionEvent`.
66+
the ``kernel.exception`` event, it is :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`.
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-
7670
Now that the class is created, you need to register it as a service and
7771
notify Symfony that it is a "listener" on the ``kernel.exception`` event by
7872
using a special "tag":
@@ -157,7 +151,7 @@ listen to the same ``kernel.exception`` event::
157151
namespace App\EventSubscriber;
158152

159153
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
160-
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
154+
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
161155
use Symfony\Component\HttpKernel\KernelEvents;
162156

163157
class ExceptionSubscriber implements EventSubscriberInterface
@@ -174,17 +168,17 @@ listen to the same ``kernel.exception`` event::
174168
];
175169
}
176170

177-
public function processException(ExceptionEvent $event)
171+
public function processException(GetResponseForExceptionEvent $event)
178172
{
179173
// ...
180174
}
181175

182-
public function logException(ExceptionEvent $event)
176+
public function logException(GetResponseForExceptionEvent $event)
183177
{
184178
// ...
185179
}
186180

187-
public function notifyException(ExceptionEvent $event)
181+
public function notifyException(GetResponseForExceptionEvent $event)
188182
{
189183
// ...
190184
}
@@ -213,11 +207,11 @@ or a "sub request"::
213207
// src/EventListener/RequestListener.php
214208
namespace App\EventListener;
215209

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

218212
class RequestListener
219213
{
220-
public function onKernelRequest(RequestEvent $event)
214+
public function onKernelRequest(GetResponseEvent $event)
221215
{
222216
if (!$event->isMasterRequest()) {
223217
// 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`: https://symfony.com/
112+
.. _`Symfony`: http://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 as the one used by
104+
The JWT must be signed with the same secret key than 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()``, ``lap()`` and
100+
inject the Stopwatch service. Then, use the ``start()``, ``lapse()`` 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->lap('user-sign-up');
107+
$stopwatch->lapse('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, it's better
45-
to :doc:`install the Symfony local web server </setup/symfony_server>` and run
46-
it as follows:
44+
document root to be the ``public/`` directory. But, for development, Symfony has
45+
its own server. Install and run it with:
4746

4847
.. code-block:: terminal
4948
50-
$ symfony server:start
49+
$ composer require --dev server
50+
$ php bin/console 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: https://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html
160+
.. _DBAL documentation: http://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`: https://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html
439+
.. _`DQL User Defined Functions`: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-user-defined-functions.html

trunk/reference/dic_tags.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ 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
3029
`monolog.logger`_ Logging with a custom logging channel
3130
`monolog.processor`_ Add a custom processor for logging
3231
`routing.loader`_ Register a custom service that loads routes
@@ -467,21 +466,6 @@ reuse the Symfony application between requests to improve performance. This tag
467466
is applied for example to the built-in :doc:`data collectors </profiler/data_collector>`
468467
of the profiler to delete all their information.
469468

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-
485469
.. _dic_tags-monolog:
486470

487471
monolog.logger

trunk/security.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,11 @@ 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+
931936
Frequently Asked Questions
932937
--------------------------
933938

@@ -1000,6 +1005,7 @@ Authorization (Denying Access)
10001005
security/access_denied_handler
10011006
security/acl
10021007
security/force_https
1008+
security/security_checker
10031009

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

trunk/security/security_checker.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. index::
2+
single: Security; Vulnerability Checker
3+
4+
How to Check for Known Security Vulnerabilities in Your Dependencies
5+
====================================================================
6+
7+
When using lots of dependencies in your Symfony projects, some of them may
8+
contain security vulnerabilities. That's why the :doc:`Symfony local server </setup/symfony_server>`
9+
includes a command called ``security:check`` that checks your ``composer.lock``
10+
file to find known security vulnerabilities in your installed dependencies:
11+
12+
.. code-block:: terminal
13+
14+
$ symfony security:check
15+
16+
A good security practice is to execute this command regularly to be able to
17+
update or replace compromised dependencies as soon as possible. The security
18+
check is done locally by cloning the `security advisories database`_ published
19+
by the FriendsOfPHP organization, so your ``composer.lock`` file is not sent on
20+
the network.
21+
22+
.. tip::
23+
24+
The ``security:check`` command terminates with a non-zero exit code if
25+
any of your dependencies is affected by a known security vulnerability.
26+
This way you can add it to your project build process and your continuous
27+
integration workflows to make them fail when there are vulnerabilities.
28+
29+
.. _`security advisories database`: https://github.com/FriendsOfPHP/security-advisories

0 commit comments

Comments
 (0)
0