X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=maintenance%2FeraseArchivedFile.php;h=1ddc0f509776f39187e963163e1ac7e5bcce233a;hb=1b8eac21abd41d0d9ddae8a4358e2aa933b0d959;hp=69a95e20bd5d5913b24bbb1b12d34d835e23de8e;hpb=b24a0048185fe7c4d86f8b55872ad749c6ab52e6;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/eraseArchivedFile.php b/maintenance/eraseArchivedFile.php index 69a95e20bd..1ddc0f5097 100644 --- a/maintenance/eraseArchivedFile.php +++ b/maintenance/eraseArchivedFile.php @@ -35,7 +35,7 @@ require_once __DIR__ . '/Maintenance.php'; class EraseArchivedFile extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Erases traces of deleted files."; + $this->addDescription( 'Erases traces of deleted files.' ); $this->addOption( 'delete', 'Perform the deletion' ); $this->addOption( 'filename', 'File name', false, true ); $this->addOption( 'filekey', 'File storage key (with extension) or "*"', true, true ); @@ -57,7 +57,7 @@ class EraseArchivedFile extends Maintenance { } else { // specified version $dbw = $this->getDB( DB_MASTER ); $row = $dbw->selectRow( 'filearchive', '*', - array( 'fa_storage_group' => 'deleted', 'fa_storage_key' => $filekey ), + [ 'fa_storage_group' => 'deleted', 'fa_storage_key' => $filekey ], __METHOD__ ); if ( !$row ) { $this->error( "No deleted file exists with key '$filekey'.", 1 ); @@ -87,7 +87,7 @@ class EraseArchivedFile extends Maintenance { protected function scrubAllVersions( $name ) { $dbw = $this->getDB( DB_MASTER ); $res = $dbw->select( 'filearchive', '*', - array( 'fa_name' => $name, 'fa_storage_group' => 'deleted' ), + [ 'fa_name' => $name, 'fa_storage_group' => 'deleted' ], __METHOD__ ); foreach ( $res as $row ) { $this->scrubVersion( ArchivedFile::newFromRow( $row ) ); @@ -101,7 +101,7 @@ class EraseArchivedFile extends Maintenance { $repo = RepoGroup::singleton()->getLocalRepo(); $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key; if ( $this->hasOption( 'delete' ) ) { - $status = $repo->getBackend()->delete( array( 'src' => $path ) ); + $status = $repo->getBackend()->delete( [ 'src' => $path ] ); if ( $status->isOK() ) { $this->output( "Deleted version '$key' ($ts) of file '$name'\n" ); } else {