/** * Restore a checkpoint by id * @param string $checkpointId id of checkpoint * @return array * @throws UnexpectedValueException if there is no checkpoint with this id */ public function restore($checkpointId) { $this->assertCheckpointExists($checkpointId); $checkpointDir = $this->locator->getCheckpointDir() . '/' . $checkpointId; $ocRoot = $this->locator->getOwnCloudRootPath(); $this->fsHelper->copyr($checkpointDir . '/' . self::CORE_DIR, $ocRoot, false); $this->fsHelper->copyr($checkpointDir . '/' . self::APP_DIR, $ocRoot . '/' . self::APP_DIR, false); }
public function restore($checkpointId) { $checkpointDir = $this->locator->getCheckpointDir() . '/' . $checkpointId; if (!$this->fsHelper->fileExists($checkpointDir)) { $message = sprintf('Checkpoint %s does not exist.', $checkpointId); throw new \UnexpectedValueException($message); } $ocRoot = $this->locator->getOwncloudRootPath(); $this->fsHelper->copyr($checkpointDir . '/' . self::CORE_DIR, $ocRoot, false); $this->fsHelper->copyr($checkpointDir . '/' . self::APP_DIR, $ocRoot . '/' . self::APP_DIR, false); }