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 "Remove `inline-block` from message boxes"
[lhc/web/wiklou.git]
/
maintenance
/
deleteOrphanedRevisions.php
diff --git
a/maintenance/deleteOrphanedRevisions.php
b/maintenance/deleteOrphanedRevisions.php
index
df496d4
..
6f3ea4c
100644
(file)
--- a/
maintenance/deleteOrphanedRevisions.php
+++ b/
maintenance/deleteOrphanedRevisions.php
@@
-26,6
+26,8
@@
require_once __DIR__ . '/Maintenance.php';
require_once __DIR__ . '/Maintenance.php';
+use Wikimedia\Rdbms\IDatabase;
+
/**
* Maintenance script that deletes revisions which refer to a nonexisting page.
*
/**
* Maintenance script that deletes revisions which refer to a nonexisting page.
*
@@
-82,16
+84,16
@@
class DeleteOrphanedRevisions extends Maintenance {
* Delete one or more revisions from the database
* Do this inside a transaction
*
* Delete one or more revisions from the database
* Do this inside a transaction
*
- * @param
array
$id Array of revision id values
- * @param
Database $dbw Database class (needs to be a master)
+ * @param
int[]
$id Array of revision id values
+ * @param
IDatabase $dbw Master DB handle
*/
*/
- private function deleteRevs( $id, &$dbw ) {
- if ( !is_array( $id ) ) {
- $id = [ $id ];
- }
+ private function deleteRevs( array $id, &$dbw ) {
$dbw->delete( 'revision', [ 'rev_id' => $id ], __METHOD__ );
$dbw->delete( 'revision', [ 'rev_id' => $id ], __METHOD__ );
+
+ // Delete from ip_changes should a record exist.
+ $dbw->delete( 'ip_changes', [ 'ipc_rev_id' => $id ], __METHOD__ );
}
}
}
}
-$maintClass =
"DeleteOrphanedRevisions"
;
+$maintClass =
DeleteOrphanedRevisions::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;