Exemplo n.º 1
0
 protected function scrubVersion(ArchivedFile $archivedFile)
 {
     $key = $archivedFile->getStorageKey();
     $name = $archivedFile->getName();
     $ts = $archivedFile->getTimestamp();
     $repo = RepoGroup::singleton()->getLocalRepo();
     $path = $repo->getZonePath('deleted') . '/' . $repo->getDeletedHashPath($key) . $key;
     if ($this->hasOption('delete')) {
         $status = $repo->getBackend()->delete(['src' => $path]);
         if ($status->isOK()) {
             $this->output("Deleted version '{$key}' ({$ts}) of file '{$name}'\n");
         } else {
             $this->output("Failed to delete version '{$key}' ({$ts}) of file '{$name}'\n");
             $this->output(print_r($status->getErrorsArray(), true));
         }
     } else {
         $this->output("Would delete version '{$key}' ({$ts}) of file '{$name}'\n");
     }
 }