Beispiel #1
0
 /** 
  * Initalize myself
  * 
  * @param string $language Language
  * 
  * @return void
  */
 public static function init($language = 'en')
 {
     if (!self::$instance) {
         if (extension_loaded('mbstring') && function_exists('mb_regex_encoding')) {
             self::$instance = PMF_String_Mbstring::getInstance($language);
         } elseif (self::isLangUTF8ToLatinConvertable($language)) {
             self::$instance = PMF_String_UTF8ToLatinConvertable::getInstance($language);
         } else {
             self::$instance = PMF_String_Basic::getInstance($language);
         }
     }
 }
Beispiel #2
0
 /** 
  * Initalize myself
  * 
  * @return void
  */
 public static function init($encoding = null, $language = 'en')
 {
     if (!self::$instance) {
         $encoding = 'utf8' == strtolower($encoding) ? 'utf-8' : $encoding;
         if (extension_loaded('mbstring') && function_exists('mb_regex_encoding')) {
             self::$instance = PMF_String_Mbstring::getInstance($encoding, $language);
         } else {
             if ($encoding == 'utf-8' && self::isLangUTF8ToLatinConvertable($language)) {
                 self::$instance = PMF_String_UTF8ToLatinConvertable::getInstance($encoding, $language);
             } else {
                 self::$instance = PMF_String_Basic::getInstance($encoding, $language);
             }
         }
     }
 }