X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpurgeChangedFiles.php;h=d21a296d7023388fabf7b69d743b203a81508fae;hb=2e5bfb55d73d93867c5a1fcb091e6beab2ef56db;hp=91c36f28d1a02e82f3f4303ff14981d884cdeb2f;hpb=adbadb9ee62284d70d9e7763379ab3b4eb6bde6f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/purgeChangedFiles.php b/maintenance/purgeChangedFiles.php index 91c36f28d1..d21a296d70 100644 --- a/maintenance/purgeChangedFiles.php +++ b/maintenance/purgeChangedFiles.php @@ -2,7 +2,6 @@ /** * Scan the logging table and purge affected files within a timeframe. * - * @section LICENSE * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -177,7 +176,6 @@ class PurgeChangedFiles extends Maintenance { // Sanity check to avoid data loss $repo->getBackend()->delete( array( 'src' => $file->getPath() ) ); $this->verbose( "Deleted orphan file: {$file->getPath()}.\n" ); - } else { $this->error( "File was not deleted: {$file->getPath()}.\n" ); } @@ -185,7 +183,6 @@ class PurgeChangedFiles extends Maintenance { // Purge items from fileachive table (rows are likely here) $this->purgeFromArchiveTable( $repo, $file ); - } elseif ( $logType === 'move' ) { // Purge the target file as well @@ -232,7 +229,6 @@ class PurgeChangedFiles extends Maintenance { // Sanity check to avoid data loss $repo->getBackend()->delete( array( 'src' => $ofile->getPath() ) ); $this->output( "Deleted orphan file: {$ofile->getPath()}.\n" ); - } else { $this->error( "File was not deleted: {$ofile->getPath()}.\n" ); } @@ -244,6 +240,7 @@ class PurgeChangedFiles extends Maintenance { protected function getDeletedPath( LocalRepo $repo, LocalFile $file ) { $hash = $repo->getFileSha1( $file->getPath() ); $key = "{$hash}.{$file->getExtension()}"; + return $repo->getDeletedHashPath( $key ) . $key; } @@ -257,7 +254,6 @@ class PurgeChangedFiles extends Maintenance { $this->output( $msg ); } } - } $maintClass = "PurgeChangedFiles";