oxstr.php

Go to the documentation of this file.
00001 <?php
00002 
00011 class oxStr
00012 {
00013 
00019     static protected $_oHandler;
00020 
00026     public function __construct()
00027     {
00028     }
00029 
00035     public static function getStr()
00036     {
00037         if (!isset(self::$_oHandler)) {
00038             //let's init now non-static instance of oxStr to get the instance of str handler
00039             self::$_oHandler = oxNew("oxStr")->_getStrHandler();
00040         }
00041 
00042         return self::$_oHandler;
00043     }
00044 
00052     protected function _getStrHandler()
00053     {
00054         if (oxRegistry::getConfig()->isUtf() && function_exists('mb_strlen')) {
00055             return oxNew("oxStrMb");
00056         }
00057 
00058         return oxNew("oxStrRegular");
00059     }
00060 }