Index: trunk/extensions/Translate/utils/TranslationMemoryUpdater.php |
— | — | @@ -92,13 +92,18 @@ |
93 | 93 | * @return DatabaseSqlite or null |
94 | 94 | */ |
95 | 95 | public static function getDatabaseHandle() { |
96 | | - global $wgTranslateTM; |
| 96 | + global $wgTranslateTranslationServices; |
97 | 97 | |
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 | + } |
100 | 105 | } |
101 | 106 | |
102 | | - $database = $wgTranslateTM['database']; |
| 107 | + if ( $database === null ) return null; |
103 | 108 | |
104 | 109 | if ( !is_string( $database ) ) { |
105 | 110 | wfDebugLog( 'tmserver', 'Database configuration is not a string' ); |