/** * see http://php.net/manual/en/function.rename.php * * @param string $path1 * @param string $path2 * @return bool */ public function rename($path1, $path2) { $result = $this->storage->rename($path1, $path2); if ($result && $this->isVersion($path2) === false && $this->encryptionManager->isEnabled()) { $source = $this->getFullPath($path1); if (!$this->util->isExcluded($source)) { $target = $this->getFullPath($path2); if (isset($this->unencryptedSize[$source])) { $this->unencryptedSize[$target] = $this->unencryptedSize[$source]; } $this->keyStorage->renameKeys($source, $target); } } return $result; }
/** * see http://php.net/manual/en/function.rename.php * * @param string $path1 * @param string $path2 * @return bool */ public function rename($path1, $path2) { $result = $this->storage->rename($path1, $path2); if ($result && // versions always use the keys from the original file, so we can skip // this step for versions $this->isVersion($path2) === false && $this->encryptionManager->isEnabled()) { $source = $this->getFullPath($path1); if (!$this->util->isExcluded($source)) { $target = $this->getFullPath($path2); if (isset($this->unencryptedSize[$source])) { $this->unencryptedSize[$target] = $this->unencryptedSize[$source]; } $this->keyStorage->renameKeys($source, $target); } } return $result; }