OXID eShop CE  4.10.1
 All Classes Namespaces Files Functions Variables Pages
oxstr.php
Go to the documentation of this file.
1 <?php
2 
11 class oxStr
12 {
13 
19  static protected $_oHandler;
20 
26  public function __construct()
27  {
28  }
29 
35  public static function getStr()
36  {
37  if (!isset(self::$_oHandler)) {
38  //let's init now non-static instance of oxStr to get the instance of str handler
39  self::$_oHandler = oxNew("oxStr")->_getStrHandler();
40  }
41 
42  return self::$_oHandler;
43  }
44 
52  protected function _getStrHandler()
53  {
54  if (oxRegistry::getConfig()->isUtf() && function_exists('mb_strlen')) {
55  return oxNew("oxStrMb");
56  }
57 
58  return oxNew("oxStrRegular");
59  }
60 }