diff --git a/convert.php b/convert.php index aa14da9..ccc24f3 100644 --- a/convert.php +++ b/convert.php @@ -53,6 +53,9 @@ class convert */ public static function ucfirst ($str) { + if (! function_exists ("mb_strtoupper")) + throw new \Exception ("PHP don't have the MB Support. Please add it !", + 500); $a = mb_strtoupper (mb_substr ($str, 0, 1, 'UTF-8'), 'UTF-8'); return $a . mb_substr ($str, 1, null, 'UTF-8'); } @@ -68,6 +71,9 @@ class convert */ public static function ucwords ($str, $delimiters = " \t\r\n\f\v") { + if (! function_exists ("mb_strtolower")) + throw new \Exception ("PHP don't have the MB Support. Please add it !", + 500); $str = mb_strtolower ($str, "utf-8"); $res = ""; foreach (preg_split ("#([".preg_quote ($delimiters)."]+)#", $str, -1, diff --git a/dblayeroo.php b/dblayeroo.php index 28ec5c7..0249338 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -72,6 +72,9 @@ class dblayeroo $driver_options=null) /* {{{ */ { + if (! function_exists ("mb_strlen")) + throw new \Exception ("PHP don't have the MB Support. Please add it !", + 500); $driver = @explode (":", $dsn); if (! isset ($driver[0])) $this->DBException (dgettext ("domframework", "No valid DSN provided")); diff --git a/fts.php b/fts.php index 17a040c..8f2ee43 100644 --- a/fts.php +++ b/fts.php @@ -51,6 +51,15 @@ class fts return $this->regexes; } + /** The constructor check the availability of the MB module + */ + public function __construct () + { + if (! function_exists ("mb_strlen")) + throw new \Exception ("PHP don't have the MB Support. Please add it !", + 500); + } + /** Search the text provided in $query in the database * @param string $query The text to found in the database * @return array The operator and the associated regex value to search diff --git a/getopts.php b/getopts.php index b1e03e0..e673c7d 100644 --- a/getopts.php +++ b/getopts.php @@ -33,6 +33,15 @@ class getopts */ private $programName; + /** The constructor check the availability of the MB module + */ + public function __construct () + { + if (! function_exists ("mb_strlen")) + throw new \Exception ("PHP don't have the MB Support. Please add it !", + 500); + } + /** Set/Get the simulate value * @param string|null $simulate The simulate to get/set */