From a18825a1eed968e47fcf9bcc3675c100a66c1613 Mon Sep 17 00:00:00 2001 From: Mark Challoner Date: Tue, 26 May 2015 10:13:57 +0100 Subject: [PATCH] [Filesystem] Added documentation for tempnam --- components/filesystem/introduction.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/filesystem/introduction.rst b/components/filesystem/introduction.rst index 74aa259c809..2699e028980 100644 --- a/components/filesystem/introduction.rst +++ b/components/filesystem/introduction.rst @@ -234,6 +234,21 @@ isAbsolutePath // return false $fs->isAbsolutePath('../dir'); +tempnam +~~~~~~~ + +.. versionadded:: 2.7 + The ``tempnam()`` function was introduced in Symfony 2.7. + +:method:`Symfony\\Component\\Filesystem\\Filesystem::tempnam` is a drop-in +replacement for PHP's builtin :phpfunction:`tempnam` function which allows +you to create a temporary file on a stream if the stream is writable. It +returns false on failure. + + $tmpFile = $fs->tempnam('ftp://example.com/tmp', 'FOO'); + +``$tmpFile`` will be the name of the temporary file or false. + dumpFile ~~~~~~~~