Improvements to caching for shared folders

remotes/origin/stable
Michael Gapczynski 14 years ago
parent a402c8ffe1
commit 053edde780
  1. 19
      apps/files_sharing/sharedstorage.php

@ -43,13 +43,22 @@ class OC_FILESTORAGE_SHARED {
}
public function getSource($target) {
print_r($this->sourcePaths);
if (array_key_exists($target, $this->sourcePaths)) {
if ($target == "") {
return false;
} elseif (array_key_exists($target, $this->sourcePaths)) {
return $this->sourcePaths[$target];
} else {
$source = OC_SHARE::getSource($target);
$this->sourcePaths[$target] = $source;
return $source;
$parentDir = dirname($target);
if ($parentDir != ".") {
$source = $this->getSource($parentDir);
return $source."/".basename($target);
} else {
$source = OC_SHARE::getSource($target);
if ($source) {
$this->sourcePaths[$target] = $source;
}
return $source;
}
}
}

Loading…
Cancel
Save