dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add @covers tags to jobqueue tests
[lhc/web/wiklou.git]
/
maintenance
/
eraseArchivedFile.php
diff --git
a/maintenance/eraseArchivedFile.php
b/maintenance/eraseArchivedFile.php
index
c90056d
..
24ef1ed
100644
(file)
--- a/
maintenance/eraseArchivedFile.php
+++ b/
maintenance/eraseArchivedFile.php
@@
-50,16
+50,17
@@
class EraseArchivedFile extends Maintenance {
if ( $filekey === '*' ) { // all versions by name
if ( !strlen( $filename ) ) {
if ( $filekey === '*' ) { // all versions by name
if ( !strlen( $filename ) ) {
- $this->
error( "Missing --filename parameter.", 1
);
+ $this->
fatalError( "Missing --filename parameter."
);
}
$afile = false;
} else { // specified version
$dbw = $this->getDB( DB_MASTER );
}
$afile = false;
} else { // specified version
$dbw = $this->getDB( DB_MASTER );
- $row = $dbw->selectRow( 'filearchive', '*',
+ $fileQuery = ArchivedFile::getQueryInfo();
+ $row = $dbw->selectRow( $fileQuery['tables'], $fileQuery['fields'],
[ 'fa_storage_group' => 'deleted', 'fa_storage_key' => $filekey ],
[ 'fa_storage_group' => 'deleted', 'fa_storage_key' => $filekey ],
- __METHOD__ );
+ __METHOD__
, [], $fileQuery['joins']
);
if ( !$row ) {
if ( !$row ) {
- $this->
error( "No deleted file exists with key '$filekey'.", 1
);
+ $this->
fatalError( "No deleted file exists with key '$filekey'."
);
}
$filename = $row->fa_name;
$afile = ArchivedFile::newFromRow( $row );
}
$filename = $row->fa_name;
$afile = ArchivedFile::newFromRow( $row );
@@
-67,7
+68,7
@@
class EraseArchivedFile extends Maintenance {
$file = wfLocalFile( $filename );
if ( $file->exists() ) {
$file = wfLocalFile( $filename );
if ( $file->exists() ) {
- $this->
error( "File '$filename' is still a public file, use the delete form.\n", 1
);
+ $this->
fatalError( "File '$filename' is still a public file, use the delete form.\n"
);
}
$this->output( "Purging all thumbnails for file '$filename'..." );
}
$this->output( "Purging all thumbnails for file '$filename'..." );
@@
-85,9
+86,10
@@
class EraseArchivedFile extends Maintenance {
protected function scrubAllVersions( $name ) {
$dbw = $this->getDB( DB_MASTER );
protected function scrubAllVersions( $name ) {
$dbw = $this->getDB( DB_MASTER );
- $res = $dbw->select( 'filearchive', '*',
+ $fileQuery = ArchivedFile::getQueryInfo();
+ $res = $dbw->select( $fileQuery['tables'], $fileQuery['fields'],
[ 'fa_name' => $name, 'fa_storage_group' => 'deleted' ],
[ 'fa_name' => $name, 'fa_storage_group' => 'deleted' ],
- __METHOD__ );
+ __METHOD__
, [], $fileQuery['joins']
);
foreach ( $res as $row ) {
$this->scrubVersion( ArchivedFile::newFromRow( $row ) );
}
foreach ( $res as $row ) {
$this->scrubVersion( ArchivedFile::newFromRow( $row ) );
}