8000 Merge branch '4.4' · githubfromgui/symfony-docs@3a8db36 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3a8db36

Browse files
committed
Merge branch '4.4'
* 4.4: [PropertyInfo] Mentioned that property types can be extracted from constructor too [Translation] Updated the default behavior of translator.fallbacks [HttpClient] Documented the auth_ntlm option
2 parents 1c21c45 + eba25d4 commit 3a8db36

File tree

4 files changed

+90
-13
lines changed

4 files changed

+90
-13
lines changed

components/http_client.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,18 @@ each request (which overrides any global authentication)::
126126

127127
// Use the same authentication for all requests
128128
$httpClient = HttpClient::create([
129-
// HTTP Basic authentication with only the username and not a password
129+
// HTTP Basic authentication (there are multiple ways of configuring it)
130130
'auth_basic' => ['the-username'],
131-
132-
// HTTP Basic authentication with a username and a password
133131
'auth_basic' => ['the-username', 'the-password'],
132+
'auth_basic' => 'the-username:the-password',
134133

135134
// HTTP Bearer authentication (also called token authentication)
136135
'auth_bearer' => 'the-bearer-token',
136+
137+
// Microsoft NTLM authentication (there are multiple ways of configuring it)
138+
'auth_ntlm' => ['the-username'],
139+
'auth_ntlm' => ['the-username', 'the-password'],
140+
'auth_ntlm' => 'the-username:the-password',
137141
]);
138142

139143
$response = $httpClient->request('GET', 'https://...', [
@@ -143,6 +147,14 @@ each request (which overrides any global authentication)::
143147
// ...
144148
]);
145149

150+
.. note::
151+
152+
The NTLM authentication mechanism requires using the cURL transport.
153+
154+
.. versionadded:: 4.4
155+
156+
The ``auth_ntlm`` option was introduced in Symfony 4.4.
157+
146158
Query String Parameters
147159
~~~~~~~~~~~~~~~~~~~~~~~
148160

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

reference/configuration/framework.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Configuration
116116
* `scope`_
117117
* `auth_basic`_
118118
* `auth_bearer`_
119+
* `auth_ntlm`_
119120
* `base_uri`_
120121
* `bindto`_
121122
* `cafile`_
@@ -726,6 +727,20 @@ auth_bearer
726727
The token used to create the ``Authorization`` HTTP header used in HTTP Bearer
727728
authentication (also called token authentication).
728729

730+
auth_ntlm
731+
.........
732+
733+
**type**: ``string``
734+
735+
.. versionadded:: 4.3
736+
737+
The ``auth_ntlm`` option was introduced in Symfony 4.4.
738+
739+
The username and password used to create the ``Authorization`` HTTP header used
740+
in the `Microsoft NTLM authentication protocol`_. The value of this option must
741+
follow the format ``username:password``. This authentication mechanism requires
742+
using the cURL-based transport.
743+
729744
base_uri
730745
........
731746

@@ -2610,3 +2625,4 @@ to know their differences.
26102625
.. _`default_socket_timeout`: https://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout
26112626
.. _`PEM formatted`: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail
26122627
.. _`haveibeenpwned.com`: https://haveibeenpwned.com/
2628+
.. _`Microsoft NTLM authentication protocol`: https://docs.microsoft.com/en-us/windows/desktop/secauthn/microsoft-ntlm

translation.rst

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Configuration
5959
-------------
6060

6161
The previous command creates an initial config file where you can define the
62-
default locale of the app and the :ref:`fallback locales <translation-fallback>`
63-
that will be used if Symfony can't find some translation:
62+
default locale of the application and the directory where the translation files
63+
are located:
6464

6565
.. configuration-block::
6666

@@ -70,8 +70,7 @@ that will be used if Symfony can't find some translation:
7070
framework:
7171
default_locale: 'en'
7272
translator:
73-
fallbacks: ['en']
74-
# ...
73+
default_path: '%kernel.project_dir%/translations'
7574
7675
.. code-block:: xml
7776
@@ -87,7 +86,7 @@ that will be used if Symfony can't find some translation:
8786
8887
<framework:config default-locale="en">
8988
<framework:translator>
90-
<framework:fallback>en</framework:fallback>
89+
<framework:default-path>'%kernel.project_dir%/translations'</framework:default-path>
9190
<!-- ... -->
9291
</framework:translator>
9392
</framework:config>
@@ -98,7 +97,7 @@ that will be used if Symfony can't find some translation:
9897
// config/packages/translation.php
9998
$container->loadFromExtension('framework', [
10099
'default_locale' => 'en',
101-
'translator' => ['fallbacks' => ['en']],
100+
'translator' => ['default_path' => '%kernel.project_dir%/translations'],
102101
// ...
103102
]);
104103
@@ -379,8 +378,52 @@ checks translation resources for several locales:
379378
#. If it wasn't found, Symfony looks for the translation in a ``fr`` translation
380379
resource (e.g. ``messages.fr.xlf``);
381380

382-
#. If the translation still isn't found, Symfony uses the ``fallbacks`` configuration
383-
parameter, which defaults to ``en`` (see `Configuration`_).
381+
#. If the translation still isn't found, Symfony uses the ``fallbacks`` option,
382+
which can be configured as follows:
383+
384+
.. configuration-block::
385+
386+
.. code-block:: yaml
387+
388+
# config/packages/translation.yaml
389+
framework:
390+
translator:
391+
fallbacks: ['en']
392+
# ...
393+
394+
.. code-block:: xml
395+
396+
<!-- config/packages/translation.xml -->
397+
<?xml version="1.0" encoding="UTF-8" ?>
398+
<container xmlns="http://symfony.com/schema/dic/services"
399+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
400+
xmlns:framework="http://symfony.com/schema/dic/symfony"
401+
xsi:schemaLocation="http://symfony.com/schema/dic/services
402+
https://symfony.com/schema/dic/services/services-1.0.xsd
403+
http://symfony.com/schema/dic/symfony
404+
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
405+
406+
<framework:config>
407+
<framework:translator>
408+
<framework:fallback>en</framework:fallback>
409+
<!-- ... -->
410+
</framework:translator>
411+
</framework:config>
412+
</container>
413+
414+
.. code-block:: php
415+
416+
// config/packages/translation.php
417+
$container->loadFromExtension('framework', [
418+
'translator' => ['fallbacks' => ['en']],
419+
// ...
420+
]);
421+
422+
.. deprecated:: 4.4
423+
424+
In Symfony versions before 4.4, the ``fallbacks`` option was initialized to
425+
``en`` (English) when not configured explicitly. Starting from Symfony 4.4,
426+
this option is initialized to the same value as the ``default_locale`` option.
384427

385428
.. note::
386429

0 commit comments

Comments
 (0)
0