Skip to content

Commit 4b9bef8

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: Fixed merge errors Client's history clear alternative Added a tip about tests and BCrypt Document that Doctrine associations don't work across different entity managers Update entity_provider.rst Reword Make require as a dev dependency Fixed invalid form validation reference use a class based service ID Fixed a wrong reference Document that Doctrine associations don't work across different entity managers Don't use OutputInterface::VERBOSITY constants, use PHP methods instead Mentioned APP_ENV for Flex apps Updated LDAP documentation for Symfony 3.1 Update deployment.rst clarify silencing deprecations in tests fix broken hash value of link Added a caution note about services that must maintain the "class" parameter Reworded the note about dump() not being available in prod
2 parents 07a9be5 + ed78811 commit 4b9bef8

File tree

14 files changed

+101
-25
lines changed

14 files changed

+101
-25
lines changed

components/browser_kit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ also delete all the cookies::
226226
$client = new Client();
227227
$client->request('GET', '/');
228228

229-
// delete history
229+
// reset the client (history and cookies are cleared too)
230230
$client->restart();
231231

232232
Learn more

components/ldap.rst

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,52 @@ LDAP server), you may query the LDAP server using the
7373

7474
// ...
7575

76-
$ldap->query('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
76+
$query = $ldap->query('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
77+
$results = $query->execute();
78+
79+
foreach ($results as $entry) {
80+
// Do something with the results
81+
}
82+
83+
By default, LDAP entries are lazy-loaded. If you wish to fetch
84+
all entries in a single call and do something with the results'
85+
array, you may use the
86+
:method:`Symfony\\Component\\Ldap\\Adapter\\ExtLdap\\Collection::toArray` method::
87+
88+
// ...
89+
90+
$query = $ldap->query('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
91+
$results = $query->execute()->toArray();
92+
93+
// Do something with the results array
94+
95+
Creating or updating entries
96+
----------------------------
97+
98+
Since version 3.1, The Ldap component provides means to create
99+
new LDAP entries, update or even delete existing ones::
100+
101+
use Symfony\Component\Ldap\Entry;
102+
// ...
103+
104+
$entry = new Entry('cn=Fabien Potencier,dc=symfony,dc=com', array(
105+
'sn' => array('fabpot'),
106+
'objectClass' => array('inetOrgPerson'),
107+
));
108+
109+
$em = $ldap->getEntryManager();
110+
111+
// Creating a new entry
112+
$em->add($entry);
113+
114+
// Finding and updating an existing entry
115+
$query = $ldap->query('dc=symfony,dc=com', '(&(objectclass=person)(ou=Maintainers))');
116+
$result = $query->execute();
117+
$entry = $result[0];
118+
$entry->addAttribute('email', array('fabpot@symfony.com'));
119+
$em->update($entry);
120+
121+
// Removing an existing entry
122+
$em->remove(new Entry('cn=Test User,dc=symfony,dc=com'));
77123

78124
.. _Packagist: https://packagist.org/packages/symfony/ldap

components/phpunit_bridge.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,25 @@ in the **Unsilenced** section of the deprecation report.
113113
Mark Tests as Legacy
114114
--------------------
115115

116-
Add the ``@group legacy`` annotation to a test class or method to mark it
117-
as legacy.
116+
There are three ways to mark a test as legacy:
117+
118+
* (**Recommended**) Add the ``@group legacy`` annotation to its class or method;
119+
120+
* Make its class name start with the ``Legacy`` prefix;
121+
122+
* Make its method name start with ``testLegacy*()`` instead of ``test*()``.
123+
124+
.. note::
125+
126+
If your data provider calls code that would usually trigger a deprecation,
127+
you can prefix its name with ``provideLegacy`` or ``getLegacy`` to silent
128+
these deprecations. If your data provider does not execute deprecated
129+
code, it is not required to choose a special naming just because the
130+
test being fed by the data provider is marked as legacy.
131+
132+
Also be aware that choosing one of the two legacy prefixes will not mark
133+
tests as legacy that make use of this data provider. You still have to
134+
mark them as legacy tests explicitly.
118135

119136
Configuration
120137
-------------

deployment.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ as you normally do:
159159
.. caution::
160160

161161
If you get a "class not found" error during this step, you may need to
162-
run ``export SYMFONY_ENV=prod`` before running this command so that
163-
the ``post-install-cmd`` scripts run in the ``prod`` environment.
162+
  run ``export SYMFONY_ENV=prod`` (or ``export APP_ENV=prod`` if you're
163+
  using :doc:`Symfony Flex </setup/flex>`) before running this command so
164+
that the ``post-install-cmd`` scripts run in the ``prod`` environment.
164165

165166
D) Clear your Symfony Cache
166167
~~~~~~~~~~~~~~~~~~~~~~~~~~~

doctrine/multiple_entity_managers.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ entity manager that connects to another database might handle the rest.
1616
usually required. Be sure you actually need multiple entity managers before
1717
adding in this layer of complexity.
1818

19+
.. caution::
20+
21+
Entities cannot define associations across different entity managers. If you
22+
need that, there are `several alternatives <https://stackoverflow.com/a/11494543/2804294>`_
23+
that require some custom setup.
24+
1925
The following configuration code shows how you can configure two entity managers:
2026

2127
.. configuration-block::

form/disabling_validation.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@ these cases you can set the ``validation_groups`` option to ``false``::
1818

1919
Note that when you do that, the form will still run basic integrity checks,
2020
for example whether an uploaded file was too large or whether non-existing
21-
fields were submitted. If you want to suppress validation, you can use the
22-
:ref:`POST_SUBMIT event <form-dynamic-form-modification-suppressing-form-validation>`.
21+
fields were submitted.
22+
23+
The submission of extra form fields can be controlled with the
24+
`allow_extra_fields config option`_ and the maximum upload file size should be
25+
handled via your PHP and web server configuration.
26+
27+
.. _`allow_extra_fields config option`: https://symfony.com/doc/current/reference/forms/types/form.html#allow-extra-fields

form/dynamic_form_modification.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -613,11 +613,3 @@ field according to the current selection in the ``sport`` field:
613613
The major benefit of submitting the whole form to just extract the updated
614614
``position`` field is that no additional server-side code is needed; all the
615615
code from above to generate the submitted form can be reused.
616-
617-
.. _form-dynamic-form-modification-suppressing-form-validation:
618-
619-
Suppressing Form Validation
620-
---------------------------
621-
622-
To suppress form validation, set ``validation_groups`` to ``false`` or an empty
623-
array.

logging/monolog_console.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ is passed when a command gets executed.
1111

1212
When a lot of logging has to happen, it's cumbersome to print information
1313
depending on the verbosity settings (``-v``, ``-vv``, ``-vvv``) because the
14-
calls need to be wrapped in conditions. The code quickly gets verbose or dirty.
15-
For example::
14+
calls need to be wrapped in conditions. For example::
1615

1716
use Symfony\Component\Console\Input\InputInterface;
1817
use Symfony\Component\Console\Output\OutputInterface;
1918

2019
protected function execute(InputInterface $input, OutputInterface $output)
2120
{
22-
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
21+
if ($output->isDebug()) {
2322
$output->writeln('Some info');
2423
}
2524

26-
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
25+
if ($output->isVerbose()) {
2726
$output->writeln('Some more info');
2827
}
2928
}

reference/configuration/security.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,12 @@ persisting the encoded password alone is enough.
614614
All the encoded passwords are ``60`` characters long, so make sure to
615615
allocate enough space for them to be persisted.
616616

617+
.. tip::
618+
619+
A simple technique to make tests much faster when using BCrypt is to set
620+
the cost to ``4``, which is the minimum value allowed, in the ``test``
621+
environment configuration.
622+
617623
.. _reference-security-firewall-context:
618624

619625
Firewall Context

security/entity_provider.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ template to customize them further).
411411
not be deserialized correctly from the session on each request.
412412

413413
Congrats! Your database-loading security system is all setup! Next, add a
414-
true :doc:`login form </security/form_login>` instead of HTTP Basic
414+
true :doc:`login form </security/form_login_setup>` instead of HTTP Basic
415415
or keep reading for other topics.
416416

417417
.. _authenticating-someone-with-a-custom-entity-provider:

service_container/3.3-di-changes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,8 +626,13 @@ Start by updating the service ids to class names:
626626

627627
Services associated with global PHP classes (i.e. not using PHP namespaces)
628628
must maintain the ``class`` parameter. For example, when using the old Twig
629+
<<<<<<< HEAD
630+
classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``)
631+
you can't redefine the service as `Twig_Extensions_Extension_Intl: ~` and
632+
=======
629633
classes (e.g. ``Twig_Extensions_Extension_Intl`` instead of ``Twig\Extensions\IntlExtension``),
630634
  you can't redefine the service as ``Twig_Extensions_Extension_Intl: ~`` and
635+
>>>>>>> upstream/3.3
631636
you must keep the original ``class`` parameter.
632637

633638
But, this change will break our app! The old service ids (e.g. ``app.github_notifier``)

service_container/compiler_passes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ How to Work with Compiler Passes in Bundles
88
Compiler passes give you an opportunity to manipulate other service
99
definitions that have been registered with the service container. You
1010
can read about how to create them in the components section
11-
":ref:`components-di-compiler-pass`".
11+
":ref:`components-di-separate-compiler-passes`".
1212

1313
When using :ref:`separate compiler passes <components-di-separate-compiler-passes>`,
1414
you need to register them in the ``build()`` method of the bundle class (this

service_container/factories.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ Configuration of the service container then looks like this:
152152
153153
# app/config/services.yml
154154
155-
app.newsletter_manager:
156-
class: AppBundle\Email\NewsletterManager
155+
AppBundle\Email\NewsletterManager:
157156
# new syntax
158157
factory: 'AppBundle\Email\NewsletterManagerFactory:createNewsletterManager'
159158
# old syntax

setup/built_in_web_server.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ First, execute this command:
2727
.. code-block:: terminal
2828
2929
$ cd your-project/
30-
$ composer require symfony/web-server-bundle
30+
$ composer require --dev symfony/web-server-bundle
3131
3232
Then, enable the bundle in the kernel of the application::
3333

0 commit comments

Comments
 (0)