diff options
author | Klaas Freitag <freitag@owncloud.com> | 2012-02-14 09:59:54 +0100 |
---|---|---|
committer | Klaas Freitag <freitag@owncloud.com> | 2012-02-14 09:59:54 +0100 |
commit | 60a03580fff65d969faea8e5788b278ed8b15481 (patch) | |
tree | 7b2286bbcf87cca0d52c348f8ef0116f4c055e53 /lib/filestorage | |
parent | d10f4f071d8a51128e0b8056e9af414af98cf833 (diff) | |
download | nextcloud-server-60a03580fff65d969faea8e5788b278ed8b15481.tar.gz nextcloud-server-60a03580fff65d969faea8e5788b278ed8b15481.zip |
allow to set a files mtime through a PROPPATCH request on resource
'lastmodified'. Needed for syncing algorithms.
Diffstat (limited to 'lib/filestorage')
-rw-r--r-- | lib/filestorage/local.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 292d2a84e7d..35db244e4d6 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -65,13 +65,16 @@ class OC_Filestorage_Local extends OC_Filestorage{ public function filemtime($path){ return filemtime($this->datadir.$path); } - - public function setFileMtime($path, $mtime){ - // sets the modification time of the file to the given value. If mtime is nil the current time is set. - // note that the access time of the file always changes to the current time. - return touch($this->datadir.$path, $mtime); - } - + public function touch($path, $mtime){ + // sets the modification time of the file to the given value. + // If mtime is nil the current time is set. + // note that the access time of the file always changes to the current time. + if( touch( $this->datadir.$path, $mtime ) ) { + clearstatcache( true, $this->datadir.$path ); + } + + return touch($this->datadir.$path, $mtime); + } public function file_get_contents($path){ return file_get_contents($this->datadir.$path); } |