Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions components/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,25 @@ isAbsolutePath returns true if the given path is absolute, false otherwise::
// return false
$fs->isAbsolutePath('../dir');

.. versionadded:: 2.3
``dumpFile`` is new in Symfony 2.3

dumpFile
~~~~~~~~

:method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` allows you to
dump contents in a file. It does it in a atomic manner, that means it writes a
temporary file first and then moves that to the new place when it's finished.
This means the user does see either the old or the new state

.. code-block:: php

$fs->dumpFile('file.txt', 'Hello World');

The ``file.txt`` file contains ``Hello World`` now.

A desired file mode can be passed as third argument.

Error Handling
--------------

Expand Down