summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-12-01 10:42:39 +0100
committerVincent Petry <pvince81@owncloud.com>2014-12-01 10:42:39 +0100
commit8db4dd7585aa9daebb32a3f3305f4061b17c316d (patch)
tree4522ffb805001025ba4e1bb0362e21e99fd4a929 /lib
parentffd1fc42e765ad43a9644317ad2f2648902c4ee5 (diff)
parent7761f0288e39c5af1815d783e0f98eeb94759889 (diff)
downloadnextcloud-server-8db4dd7585aa9daebb32a3f3305f4061b17c316d.tar.gz
nextcloud-server-8db4dd7585aa9daebb32a3f3305f4061b17c316d.zip
Merge pull request #12469 from owncloud/issue/12460-port-local-changes2mapped
Issue/12460 port local changes2mapped
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/mappedlocal.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php
index 1b26e3ac0f9..fe6fff4ebdb 100644
--- a/lib/private/files/storage/mappedlocal.php
+++ b/lib/private/files/storage/mappedlocal.php
@@ -109,6 +109,7 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public function stat($path) {
+ clearstatcache();
$fullPath = $this->getSourcePath($path);
$statResult = stat($fullPath);
if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) {
@@ -159,6 +160,9 @@ class MappedLocal extends \OC\Files\Storage\Common {
// 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 ($this->file_exists($path) and !$this->isUpdatable($path)) {
+ return false;
+ }
if (!is_null($mtime)) {
$result = touch($this->getSourcePath($path), $mtime);
} else {
@@ -292,7 +296,11 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
public function free_space($path) {
- return @disk_free_space($this->getSourcePath($path));
+ $space = @disk_free_space($this->getSourcePath($path));
+ if ($space === false || is_null($space)) {
+ return \OCP\Files\FileInfo::SPACE_UNKNOWN;
+ }
+ return $space;
}
public function search($query) {
@@ -337,7 +345,11 @@ class MappedLocal extends \OC\Files\Storage\Common {
* @return bool
*/
public function hasUpdated($path, $time) {
- return $this->filemtime($path) > $time;
+ if ($this->file_exists($path)) {
+ return $this->filemtime($path) > $time;
+ } else {
+ return true;
+ }
}
/**
@@ -353,6 +365,13 @@ class MappedLocal extends \OC\Files\Storage\Common {
}
/**
+ * {@inheritdoc}
+ */
+ public function isLocal() {
+ return true;
+ }
+
+ /**
* @param string $path
* @return string
*/