*/
private function checkOrphans( $fix ) {
$dbw = $this->getDB( DB_MASTER );
- $commentStore = new CommentStore( 'rev_comment' );
+ $commentStore = CommentStore::getStore();
if ( $fix ) {
$this->lockTables( $dbw );
}
- $commentQuery = $commentStore->getJoin();
+ $commentQuery = $commentStore->getJoin( 'rev_comment' );
$this->output( "Checking for orphan revision table entries... "
. "(this may take a while on a large wiki)\n" );
) );
foreach ( $result as $row ) {
- $comment = $commentStore->getComment( $row )->text;
+ $comment = $commentStore->getComment( 'rev_comment', $row )->text;
if ( $comment !== '' ) {
$comment = '(' . $wgContLang->truncate( $comment, 40 ) . ')';
}
$result2 = $dbw->query( "
SELECT MAX(rev_timestamp) as max_timestamp
FROM $revision
- WHERE rev_page=$row->page_id
- " );
+ WHERE rev_page=" . (int)( $row->page_id )
+ );
$row2 = $dbw->fetchObject( $result2 );
if ( $row2 ) {
if ( $row->rev_timestamp != $row2->max_timestamp ) {
}
}
-$maintClass = "Orphans";
+$maintClass = Orphans::class;
require_once RUN_MAINTENANCE_IF_MAIN;