Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/239106
Change subject: Remove configuration options for the cdb files
......................................................................
Remove configuration options for the cdb files
Change-Id: I7134c16a46ff8b4b03d8d67edb3f6b0775ec3b55
---
M Babel.class.php
M Babel.php
M BabelLanguageCodes.class.php
M extension.json
4 files changed, 5 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Babel
refs/changes/06/239106/1
diff --git a/Babel.class.php b/Babel.class.php
index 1ea0289..cf8e897 100644
--- a/Babel.class.php
+++ b/Babel.class.php
@@ -22,13 +22,6 @@
*/
protected static $title;
- public static function registerExtension() {
- global $wgBabelLanguageCodesCdb, $wgBabelLanguageNamesCdb;
-
- $wgBabelLanguageCodesCdb = __DIR__ . '/codes.cdb';
- $wgBabelLanguageNamesCdb = __DIR__ . '/names.cdb';
- }
-
/**
* Render the Babel tower.
*
diff --git a/Babel.php b/Babel.php
index c8f3594..37bc14e 100644
--- a/Babel.php
+++ b/Babel.php
@@ -56,10 +56,8 @@
'remoteExtPath' => 'Babel',
);
-// Configuration setttings.
-// Language names and codes constant database files, the defaults should
suffice.
-$GLOBALS['wgBabelLanguageCodesCdb'] = __DIR__ . '/codes.cdb';
-$GLOBALS['wgBabelLanguageNamesCdb'] = __DIR__ . '/names.cdb';
+// Configuration settings.
+
// Array of possible levels, and their category name - variables: %code%
%wikiname% %nativename%
// Set to false to disable categories for a particular level.
// Alphabetical levels should be in upper case.
@@ -96,4 +94,4 @@
class_alias( 'CdbException', 'Cdb\Exception' );
class_alias( 'CdbReader', 'Cdb\Reader' );
class_alias( 'CdbWriter', 'Cdb\Writer' );
-}
\ No newline at end of file
+}
diff --git a/BabelLanguageCodes.class.php b/BabelLanguageCodes.class.php
index 2092076..78bc59c 100644
--- a/BabelLanguageCodes.class.php
+++ b/BabelLanguageCodes.class.php
@@ -21,8 +21,6 @@
* @return String (language code) or false (invalid language code).
*/
public static function getCode( $code ) {
- global $wgBabelLanguageCodesCdb;
-
$mediawiki = Language::fetchLanguageName( $code );
if ( $mediawiki !== '' ) {
return $code;
@@ -30,7 +28,7 @@
$codes = false;
try {
- $codesCdb = Cdb\Reader::open( $wgBabelLanguageCodesCdb
);
+ $codesCdb = Cdb\Reader::open( __DIR__ . '/codes.cdb' );
$codes = $codesCdb->get( $code );
} catch ( Cdb\Exception $e ) {
wfDebug( __METHOD__ . ": CdbException caught, error
message was "
@@ -51,8 +49,6 @@
* @return String (name of language) or false (invalid language code).
*/
public static function getName( $code, $language = null ) {
- global $wgBabelLanguageNamesCdb;
-
// Get correct code, even though it should already be correct.
$code = self::getCode( $code );
if ( $code === false ) {
@@ -67,7 +63,7 @@
$codes = false;
try {
- $namesCdb = Cdb\Reader::open( $wgBabelLanguageNamesCdb
);
+ $namesCdb = Cdb\Reader::open( __DIR__ . '/names.cdb' );
$codes = $namesCdb->get( $code );
} catch ( Cdb\Exception $e ) {
wfDebug( __METHOD__ . ": CdbException caught, error
message was "
diff --git a/extension.json b/extension.json
index aeb0896..1dda567 100644
--- a/extension.json
+++ b/extension.json
@@ -6,7 +6,6 @@
"descriptionmsg": "babel-desc",
"license-name": "GPL-2.0+",
"type": "parserhook",
- "callback": "Babel::registerExtension",
"MessagesDirs": {
"Babel": [
"i18n"
--
To view, visit https://gerrit.wikimedia.org/r/239106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7134c16a46ff8b4b03d8d67edb3f6b0775ec3b55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Babel
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits