up-to-date, it will do nothing.
TEXT;
- $this->addOption( 'force', 'Run on all rows, even if the collation is ' .
+ $this->addOption( 'force', 'Run on all rows, even if the collation is ' .
'supposed to be up-to-date.' );
$this->addOption( 'previous-collation', 'Set the previous value of ' .
'$wgCategoryCollation here to speed up this script, especially if your ' .
);
$this->output( " processing..." );
- $dbw->begin();
+ $dbw->begin( __METHOD__ );
foreach ( $res as $row ) {
$title = Title::newFromRow( $row );
if ( !$row->cl_collation ) {
# This is an old-style row, so the sortkey needs to be
# converted.
if ( $row->cl_sortkey == $title->getText()
- || $row->cl_sortkey == $title->getPrefixedText() ) {
+ || $row->cl_sortkey == $title->getPrefixedText() ) {
$prefix = '';
} else {
# Custom sortkey, use it as a prefix
__METHOD__
);
}
- $dbw->commit();
+ $dbw->commit( __METHOD__ );
if ( $force && $row ) {
$encFrom = $dbw->addQuotes( $row->cl_from );
$encTo = $dbw->addQuotes( $row->cl_to );
- $batchConds = array(
+ $batchConds = array(
"(cl_from = $encFrom AND cl_to > $encTo) " .
" OR cl_from > $encFrom" );
}
$count += $res->numRows();
$this->output( "$count done.\n" );
-
+
if ( ++$batchCount % self::SYNC_INTERVAL == 0 ) {
$this->output( "Waiting for slaves ... " );
wfWaitForSlaves();