From 64b484e32e2d16736a8bacc86980026deefcf42a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 10 Feb 2013 12:44:27 +0100 Subject: Emulate touch() for backends that don't support it Backport of 9738fae3cf1ad18593d21eb62e138e00c01f5f36 --- lib/files/view.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/files/view.php') diff --git a/lib/files/view.php b/lib/files/view.php index f02e3d4d513..65c5a527a1b 100644 --- a/lib/files/view.php +++ b/lib/files/view.php @@ -254,7 +254,11 @@ class View { $hooks[] = 'write'; } - return $this->basicOperation('touch', $path, $hooks, $mtime); + $result = $this->basicOperation('touch', $path, array('write'), $mtime); + if (!$result) { //if native touch fails, we emulate it by changing the mtime in the cache + $this->putFileInfo($path, array('mtime' => $mtime)); + } + return true; } public function file_get_contents($path) { -- cgit v1.2.3