Move mbstring initializaton to Setup.php, add checks
authorMax Semenik <maxsem.wiki@gmail.com>
Mon, 13 Jun 2016 21:28:28 +0000 (14:28 -0700)
committerMaxSem <maxsem.wiki@gmail.com>
Mon, 13 Jun 2016 21:47:47 +0000 (21:47 +0000)
Bug: T137509
Change-Id: Ib3496c9465a7b229b97793c6fa5dafb878c04968

includes/Setup.php
languages/Language.php

index 2c78061..878b147 100644 (file)
@@ -45,6 +45,13 @@ if ( !isset( $wgVersion ) ) {
        die( 1 );
 }
 
+if ( function_exists( 'mb_internal_encoding' ) ) {
+       mb_internal_encoding( 'UTF-8' );
+} elseif ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
+       echo "Error: the mbstring PHP extension is required\n";
+       die( 1 );
+}
+
 // Set various default paths sensibly...
 $ps_default = Profiler::instance()->scopedProfileIn( $fname . '-defaults' );
 
index 0a6ccd3..f0c7d76 100644 (file)
@@ -30,8 +30,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
        exit( 1 );
 }
 
-mb_internal_encoding( 'UTF-8' );
-
 use CLDRPluralRuleParser\Evaluator;
 
 /**