r73885 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73884‎ | r73885 | r73886 >
Date:12:37, 28 September 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
There is no such global as $wgTranslateTM anymore
Modified paths:
  • /trunk/extensions/Translate/utils/TranslationMemoryUpdater.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslationMemoryUpdater.php
@@ -92,13 +92,18 @@
9393 * @return DatabaseSqlite or null
9494 */
9595 public static function getDatabaseHandle() {
96 - global $wgTranslateTM;
 96+ global $wgTranslateTranslationServices;
9797
98 - if ( !isset( $wgTranslateTM['database'] ) ) {
99 - return null;
 98+ $database = null;
 99+
 100+ foreach ( $wgTranslateTranslationServices as $service => $config ) {
 101+ if ( $config['type'] === 'tmserver' && isset( $config['database'] ) ) {
 102+ $database = $config['database'];
 103+ break;
 104+ }
100105 }
101106
102 - $database = $wgTranslateTM['database'];
 107+ if ( $database === null ) return null;
103108
104109 if ( !is_string( $database ) ) {
105110 wfDebugLog( 'tmserver', 'Database configuration is not a string' );

Status & tagging log