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
Merge "Move CookieJar class to own file"
[lhc/web/wiklou.git]
/
maintenance
/
deleteOrphanedRevisions.php
diff --git
a/maintenance/deleteOrphanedRevisions.php
b/maintenance/deleteOrphanedRevisions.php
index
776d345
..
507a494
100644
(file)
--- a/
maintenance/deleteOrphanedRevisions.php
+++ b/
maintenance/deleteOrphanedRevisions.php
@@
-34,7
+34,8
@@
require_once __DIR__ . '/Maintenance.php';
class DeleteOrphanedRevisions extends Maintenance {
public function __construct() {
parent::__construct();
class DeleteOrphanedRevisions extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Maintenance script to delete revisions which refer to a nonexisting page";
+ $this->addDescription(
+ 'Maintenance script to delete revisions which refer to a nonexisting page' );
$this->addOption( 'report', 'Prints out a count of affected revisions but doesn\'t delete them' );
}
$this->addOption( 'report', 'Prints out a count of affected revisions but doesn\'t delete them' );
}
@@
-43,7
+44,7
@@
class DeleteOrphanedRevisions extends Maintenance {
$report = $this->hasOption( 'report' );
$report = $this->hasOption( 'report' );
- $dbw =
wfG
etDB( DB_MASTER );
+ $dbw =
$this->g
etDB( DB_MASTER );
$this->beginTransaction( $dbw, __METHOD__ );
list( $page, $revision ) = $dbw->tableNamesN( 'page', 'revision' );
$this->beginTransaction( $dbw, __METHOD__ );
list( $page, $revision ) = $dbw->tableNamesN( 'page', 'revision' );
@@
-54,7
+55,7
@@
class DeleteOrphanedRevisions extends Maintenance {
$res = $dbw->query( $sql, 'deleteOrphanedRevisions' );
# Stash 'em all up for deletion (if needed)
$res = $dbw->query( $sql, 'deleteOrphanedRevisions' );
# Stash 'em all up for deletion (if needed)
- $revisions =
array()
;
+ $revisions =
[]
;
foreach ( $res as $row ) {
$revisions[] = $row->rev_id;
}
foreach ( $res as $row ) {
$revisions[] = $row->rev_id;
}
@@
-86,9
+87,9
@@
class DeleteOrphanedRevisions extends Maintenance {
*/
private function deleteRevs( $id, &$dbw ) {
if ( !is_array( $id ) ) {
*/
private function deleteRevs( $id, &$dbw ) {
if ( !is_array( $id ) ) {
- $id =
array( $id )
;
+ $id =
[ $id ]
;
}
}
- $dbw->delete( 'revision',
array( 'rev_id' => $id )
, __METHOD__ );
+ $dbw->delete( 'revision',
[ 'rev_id' => $id ]
, __METHOD__ );
}
}
}
}