Exemplo n.º 1
0
 /**
  * update the filesystem after a rename has been detected
  * @param string oldPath
  * @param string newPath
  * @param string root (optional)
  */
 public static function rename($oldPath, $newPath, $root = false)
 {
     if (!OC_FileCache::inCache($oldPath, $root)) {
         return;
     }
     if ($root === false) {
         $view = OC_Filesystem::getView();
     } else {
         $view = new OC_FilesystemView($root);
     }
     $cached = OC_FileCache_Cached::get($oldPath, $root);
     $oldSize = $cached['size'];
     OC_FileCache::increaseSize(dirname($oldPath), -$oldSize, $root);
     OC_FileCache::increaseSize(dirname($newPath), $oldSize, $root);
     OC_FileCache::move($oldPath, $newPath);
 }