diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index b0eaeecf723..bbb245a82ff 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -569,7 +569,13 @@ class OC_Filestorage_Shared extends OC_Filestorage { return $storage->getLocalFile($this->getInternalPath($source)); } } - + public function touch($path, $mtime=null){ + $source = $this->getSource($path); + if ($source) { + $storage = OC_Filesystem::getStorage($source); + return $storage->touch($this->getInternalPath($source),$time); + } + } } -?> \ No newline at end of file +?> diff --git a/lib/filestorage.php b/lib/filestorage.php index 34fa6457fd2..d6197b88b03 100644 --- a/lib/filestorage.php +++ b/lib/filestorage.php @@ -53,5 +53,6 @@ class OC_Filestorage{ public function hash($type,$path,$raw){} public function free_space($path){} public function search($query){} + public function touch($path, $mtime=null){} public function getLocalFile($path){}// get a path to a local version of the file, whether the original file is local or remote } diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 71eccb5d1e0..ccf57638f8f 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -70,15 +70,20 @@ class OC_Filestorage_Local extends OC_Filestorage{ public function fileatime($path){ return fileatime($this->datadir.$path); } - public function touch($path, $mtime){ + public function touch($path, $mtime=null){ // 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 ) ) { + if(!is_null($mtime)){ + $result=touch( $this->datadir.$path, $mtime ); + }else{ + $result=touch( $this->datadir.$path); + } + if( $result ) { clearstatcache( true, $this->datadir.$path ); } - return touch($this->datadir.$path, $mtime); + return $result; } public function file_get_contents($path){ return file_get_contents($this->datadir.$path); diff --git a/lib/filesystem.php b/lib/filesystem.php index 986dfea64f6..4dfdbc719dc 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -369,7 +369,7 @@ class OC_Filesystem{ static public function fileatime($path){ return self::basicOperation('fileatime',$path); } - static public function touch($path, $mtime){ + static public function touch($path, $mtime=null){ return self::$defaultInstance->touch($path, $mtime); } static public function file_get_contents($path){