From 06e21fff03bb33be36cf12150cc4b82c2672df47 Mon Sep 17 00:00:00 2001 From: Iltar van der Berg Date: Fri, 4 Jan 2013 12:28:25 +0100 Subject: [PATCH] Filesystem::touch() not working with different owners (utime/atime issue) --- src/Symfony/Component/Filesystem/Filesystem.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index cb03996d32..778bd236f3 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -100,12 +100,9 @@ class Filesystem */ public function touch($files, $time = null, $atime = null) { - if (null === $time) { - $time = time(); - } - foreach ($this->toIterator($files) as $file) { - if (true !== @touch($file, $time, $atime)) { + $touch = $time ? @touch($file, $time, $atime) : @touch($file); + if (true !== $touch) { throw new IOException(sprintf('Failed to touch %s', $file)); } }