From 26ab829d5ad62e19c8de172a8dbfb0f1ad93da19 Mon Sep 17 00:00:00 2001
From: mark_story <mark@mark-story.com>
Date: Wed, 29 Jul 2015 22:01:27 -0400
Subject: [PATCH] Bootstrap Configure after the mb_* shims have been defined.

By bootstrapping after the shims have been defined allows the shims to
be used by Inflector which is often involved with bootstrapping.

Refs #7135
---
 lib/Cake/bootstrap.php | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php
index 4ad77a21b..b17c9f68f 100644
--- a/lib/Cake/bootstrap.php
+++ b/lib/Cake/bootstrap.php
@@ -172,17 +172,6 @@ Configure::write('App.imageBaseUrl', IMAGES_URL);
 Configure::write('App.cssBaseUrl', CSS_URL);
 Configure::write('App.jsBaseUrl', JS_URL);
 
-Configure::bootstrap(isset($boot) ? $boot : true);
-
-if (function_exists('mb_internal_encoding')) {
-	$encoding = Configure::read('App.encoding');
-	if (!empty($encoding)) {
-		mb_internal_encoding($encoding);
-	}
-	if (!empty($encoding) && function_exists('mb_regex_encoding')) {
-		mb_regex_encoding($encoding);
-	}
-}
 
 if (!function_exists('mb_stripos')) {
 
@@ -438,3 +427,15 @@ if (!function_exists('mb_encode_mimeheader')) {
 	}
 
 }
+
+Configure::bootstrap(isset($boot) ? $boot : true);
+
+if (function_exists('mb_internal_encoding')) {
+	$encoding = Configure::read('App.encoding');
+	if (!empty($encoding)) {
+		mb_internal_encoding($encoding);
+	}
+	if (!empty($encoding) && function_exists('mb_regex_encoding')) {
+		mb_regex_encoding($encoding);
+	}
+}