[Pkg-owncloud-commits] [php-sabredav] 31/75: Clear cache to avoid a bad ETag computation.

David Prévot taffit at moszumanska.debian.org
Thu Feb 26 18:51:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit a93b4e2b9ab0bc61780d26db7e8d370cfface3b2
Author: Ivan Enderlin <ivan.enderlin at hoa-project.net>
Date:   Tue Feb 10 10:10:13 2015 +0100

    Clear cache to avoid a bad ETag computation.
---
 lib/DAV/FS/Directory.php    | 4 +++-
 lib/DAV/FS/File.php         | 1 +
 lib/DAV/FSExt/Directory.php | 2 ++
 lib/DAV/FSExt/File.php      | 2 ++
 4 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/DAV/FS/Directory.php b/lib/DAV/FS/Directory.php
index f68b0c8..1774b67 100644
--- a/lib/DAV/FS/Directory.php
+++ b/lib/DAV/FS/Directory.php
@@ -39,7 +39,8 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
     function createFile($name, $data = null) {
 
         $newPath = $this->path . '/' . $name;
-        file_put_contents($newPath,$data);
+        file_put_contents($newPath, $data);
+        clearstatcache(true, $newPath);
 
     }
 
@@ -53,6 +54,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota {
 
         $newPath = $this->path . '/' . $name;
         mkdir($newPath);
+        clearstatcache(true, $newPath);
 
     }
 
diff --git a/lib/DAV/FS/File.php b/lib/DAV/FS/File.php
index 454e8ad..a15d57b 100644
--- a/lib/DAV/FS/File.php
+++ b/lib/DAV/FS/File.php
@@ -22,6 +22,7 @@ class File extends Node implements DAV\IFile {
     function put($data) {
 
         file_put_contents($this->path,$data);
+        clearstatcache(true, $this->path);
 
     }
 
diff --git a/lib/DAV/FSExt/Directory.php b/lib/DAV/FSExt/Directory.php
index 7d98db2..3a7283d 100644
--- a/lib/DAV/FSExt/Directory.php
+++ b/lib/DAV/FSExt/Directory.php
@@ -43,6 +43,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTa
         if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
         $newPath = $this->path . '/' . $name;
         file_put_contents($newPath,$data);
+        clearstatcache(true, $newPath);
 
         return '"' . sha1(
             fileinode($newPath) .
@@ -64,6 +65,7 @@ class Directory extends Node implements DAV\ICollection, DAV\IQuota, DAV\IMoveTa
         if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..');
         $newPath = $this->path . '/' . $name;
         mkdir($newPath);
+        clearstatcache(true, $newPath);
 
     }
 
diff --git a/lib/DAV/FSExt/File.php b/lib/DAV/FSExt/File.php
index 51f4e00..7a7bfe5 100644
--- a/lib/DAV/FSExt/File.php
+++ b/lib/DAV/FSExt/File.php
@@ -23,6 +23,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
     function put($data) {
 
         file_put_contents($this->path,$data);
+        clearstatcache(true, $this->path);
         return $this->getETag();
 
     }
@@ -75,6 +76,7 @@ class File extends Node implements DAV\PartialUpdate\IPatchSupport {
             stream_copy_to_stream($data,$f);
         }
         fclose($f);
+        clearstatcache(true, $this->path);
         return $this->getETag();
 
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list