diff options
Diffstat (limited to 'www/wiki/extensions/Translate/scripts/populateFuzzy.php')
-rw-r--r-- | www/wiki/extensions/Translate/scripts/populateFuzzy.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/www/wiki/extensions/Translate/scripts/populateFuzzy.php b/www/wiki/extensions/Translate/scripts/populateFuzzy.php index 5bac0ca7..32ff07ce 100644 --- a/www/wiki/extensions/Translate/scripts/populateFuzzy.php +++ b/www/wiki/extensions/Translate/scripts/populateFuzzy.php @@ -4,7 +4,7 @@ * * @author Niklas Laxström * @copyright Copyright © 2009-2013, Niklas Laxström - * @license GPL-2.0+ + * @license GPL-2.0-or-later * @file */ @@ -45,20 +45,20 @@ class PopulateFuzzy extends Maintenance { } $dbw = wfGetDB( DB_MASTER ); - $tables = array( 'page', 'text', 'revision' ); - $fields = array( 'page_id', 'page_title', 'page_namespace', 'rev_id', 'old_text', 'old_flags' ); - $conds = array( + $tables = [ 'page', 'text', 'revision' ]; + $fields = [ 'page_id', 'page_title', 'page_namespace', 'rev_id', 'old_text', 'old_flags' ]; + $conds = [ 'page_latest = rev_id', 'old_id = rev_text_id', 'page_namespace' => $namespace, - ); + ]; $limit = 100; $offset = 0; while ( true ) { - $inserts = array(); + $inserts = []; $this->output( '.', 0 ); - $options = array( 'LIMIT' => $limit, 'OFFSET' => $offset ); + $options = [ 'LIMIT' => $limit, 'OFFSET' => $offset ]; $res = $dbw->select( $tables, $fields, $conds, __METHOD__, $options ); if ( !$res->numRows() ) { @@ -68,11 +68,11 @@ class PopulateFuzzy extends Maintenance { foreach ( $res as $r ) { $text = Revision::getRevisionText( $r ); if ( strpos( $text, TRANSLATE_FUZZY ) !== false ) { - $inserts[] = array( + $inserts[] = [ 'rt_page' => $r->page_id, 'rt_revision' => $r->rev_id, 'rt_type' => RevTag::getType( 'fuzzy' ), - ); + ]; } } @@ -83,5 +83,5 @@ class PopulateFuzzy extends Maintenance { } } -$maintClass = 'PopulateFuzzy'; +$maintClass = PopulateFuzzy::class; require_once RUN_MAINTENANCE_IF_MAIN; |