Skip to content

Commit 9ac9242

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: Removed an unnecessary tip [Form] Additional hints when rendering the same form in different templates Note that file_put_contents is non-atomic
2 parents d19e036 + d29ee51 commit 9ac9242

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

components/dependency_injection/compilation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,14 @@ serves at dumping the compiled container::
468468
file_put_contents($file, $dumper->dump());
469469
}
470470

471+
.. tip::
472+
473+
The ``file_put_contents()`` function is not atomic. That could cause issues
474+
in a production environment with multiple concurrent requests. Instead, use
475+
the :ref:`dumpFile() method <filesystem-dumpfile>` from Symfony Filesystem
476+
component or other methods provided by Symfony (e.g. ``$containerConfigCache->write()``)
477+
which are atomic.
478+
471479
``ProjectServiceContainer`` is the default name given to the dumped container
472480
class. However, you can change this with the ``class`` option when you
473481
dump it::

components/filesystem.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ exception on failure::
287287
// returns a path like : /tmp/prefix_wyjgtF.png
288288
$filesystem->tempnam('/tmp', 'prefix_', '.png');
289289

290+
.. _filesystem-dumpfile:
291+
290292
``dumpFile``
291293
~~~~~~~~~~~~
292294

forms.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -442,16 +442,6 @@ possible paths:
442442
data is passed to it, you can
443443
:doc:`use the submit() method to handle form submissions </form/direct_submit>`.
444444

445-
.. tip::
446-
447-
If you need to render and process the same form in different templates,
448-
use the ``render()`` function to :ref:`embed the controller <templates-embed-controllers>`
449-
that processes the form:
450-
451-
.. code-block:: twig
452-
453-
{{ render(controller('App\\Controller\\TaskController::new')) }}
454-
455445
.. _validating-forms:
456446

457447
Validating Forms

0 commit comments

Comments
 (0)