[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/i18n/src/charset/ -> driver.inc.php (source)

   1  <?php
   2  /*

   3   * Limb PHP Framework

   4   *

   5   * @link http://limb-project.com

   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)

   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html

   8   */
   9  
  10  /**

  11   * @package i18n

  12   * @version $Id: driver.inc.php 5969 2007-06-08 10:51:09Z pachanga $

  13   */
  14  lmb_require('limb/i18n/src/charset/lmbSingleByteCharsetDriver.class.php');
  15  
  16  function lmb_use_charset_driver($driver)
  17  {
  18    $prev_driver = lmb_get_charset_driver();
  19    $GLOBALS['LIMB_CHARSET_DRIVER'] = $driver;
  20    return $prev_driver;
  21  }
  22  
  23  function lmb_get_charset_driver()
  24  {
  25    if(isset($GLOBALS['LIMB_CHARSET_DRIVER']))
  26      return $GLOBALS['LIMB_CHARSET_DRIVER'];
  27  }
  28  
  29  if(!lmb_get_charset_driver())
  30  {
  31    include_once(dirname(__FILE__) . '/lmbSingleByteCharsetDriver.class.php');
  32    lmb_use_charset_driver(new lmbSingleByteCharsetDriver());
  33  }
  34  
  35  /**

  36   * Multibyte aware replacement for strlen()

  37   */
  38  function lmb_strlen($string)
  39  {
  40    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strlen($string);
  41  }
  42  /**

  43   * @deprecated

  44   */
  45  function _strlen($string)
  46  {
  47    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strlen($string);
  48  }
  49  /**

  50   * Multibyte aware replacement for substr()

  51   */
  52  function lmb_substr($str, $start, $length=null)
  53  {
  54    return $GLOBALS['LIMB_CHARSET_DRIVER']->_substr($str, $start, $length);
  55  }
  56  /**

  57   * @deprecated

  58   */
  59  function _substr($str, $start, $length=null)
  60  {
  61    return $GLOBALS['LIMB_CHARSET_DRIVER']->_substr($str, $start, $length);
  62  }
  63  /**

  64   * Multibyte aware replacement for strrepalce()

  65   */
  66  function lmb_str_replace($s, $r, $str)
  67  {
  68    return $GLOBALS['LIMB_CHARSET_DRIVER']->_str_replace($s, $r, $str);
  69  }
  70  /**

  71   * @deprecated

  72   */
  73  function _str_replace($s, $r, $str)
  74  {
  75    return $GLOBALS['LIMB_CHARSET_DRIVER']->_str_replace($s, $r, $str);
  76  }
  77  /**

  78   * Multibyte aware replacement for ltrim()

  79   */
  80  function lmb_ltrim($str, $charlist = '')
  81  {
  82    return $GLOBALS['LIMB_CHARSET_DRIVER']->_ltrim($str, $charlist);
  83  }
  84  /**

  85   * @deprecated

  86   */
  87  function _ltrim($str, $charlist = '')
  88  {
  89    return $GLOBALS['LIMB_CHARSET_DRIVER']->_ltrim($str, $charlist);
  90  }
  91  /**

  92   * Multibyte aware replacement for ltrim()

  93   */
  94  function lmb_rtrim($str, $charlist = '')
  95  {
  96    return $GLOBALS['LIMB_CHARSET_DRIVER']->_rtrim($str, $charlist);
  97  }
  98  /**

  99   * @deprecated

 100   */
 101  function _rtrim($str, $charlist = '')
 102  {
 103    return $GLOBALS['LIMB_CHARSET_DRIVER']->_rtrim($str, $charlist);
 104  }
 105  /**

 106   * Multibyte aware replacement for trim()

 107   */
 108  function lmb_trim($str, $charlist = '')
 109  {
 110    if($charlist == '')
 111      return $GLOBALS['LIMB_CHARSET_DRIVER']->_trim($str);
 112    else
 113      return $GLOBALS['LIMB_CHARSET_DRIVER']->_trim($str, $charlist);
 114  }
 115  /**

 116   * @deprecated

 117   */
 118  function _trim($str, $charlist = '')
 119  {
 120    if($charlist == '')
 121      return $GLOBALS['LIMB_CHARSET_DRIVER']->_trim($str);
 122    else
 123      return $GLOBALS['LIMB_CHARSET_DRIVER']->_trim($str, $charlist);
 124  }
 125  /**

 126   * This is a unicode aware replacement for strtolower()

 127   */
 128  function lmb_strtolower($string)
 129  {
 130    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strtolower($string);
 131  }
 132  /**

 133   * @deprecated

 134   */
 135  function _strtolower($string)
 136  {
 137    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strtolower($string);
 138  }
 139  /**

 140   * This is a unicode aware replacement for strtoupper()

 141   */
 142  function lmb_strtoupper($string)
 143  {
 144    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strtoupper($string);
 145  }
 146  /**

 147   * @deprecated

 148   */
 149  function _strtoupper($string)
 150  {
 151    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strtoupper($string);
 152  }
 153  /**

 154   * Multibyte aware replacement for strpos

 155   */
 156  function lmb_strpos($haystack, $needle, $offset=null)
 157  {
 158    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strpos($haystack, $needle, $offset);
 159  }
 160  /**

 161   * @deprecated

 162   */
 163  function _strpos($haystack, $needle, $offset=null)
 164  {
 165    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strpos($haystack, $needle, $offset);
 166  }
 167  /**

 168   * Multibyte aware replacement for strrpos

 169   */
 170  function lmb_strrpos($haystack, $needle, $offset=null)
 171  {
 172    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strrpos($haystack, $needle, $offset);
 173  }
 174  /**

 175   * @deprecated

 176   */
 177  function _strrpos($haystack, $needle, $offset=null)
 178  {
 179    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strrpos($haystack, $needle, $offset);
 180  }
 181  /**

 182   * Multibyte aware replacement for ucfirst

 183   */
 184  function lmb_ucfirst($str)
 185  {
 186    return $GLOBALS['LIMB_CHARSET_DRIVER']->_ucfirst($str);
 187  }
 188  /**

 189   * @deprecated

 190   */
 191  function _ucfirst($str)
 192  {
 193    return $GLOBALS['LIMB_CHARSET_DRIVER']->_ucfirst($str);
 194  }
 195  /*

 196   * Multibyte aware replacement for strcasecmp

 197   */
 198  function lmb_strcasecmp($strX, $strY)
 199  {
 200    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strcasecmp($strX, $strY);
 201  }
 202  /**

 203   * @deprecated

 204   */
 205  function _strcasecmp($strX, $strY)
 206  {
 207    return $GLOBALS['LIMB_CHARSET_DRIVER']->_strcasecmp($strX, $strY);
 208  }
 209  /**

 210   * Multibyte aware replacement for substr_count

 211   */
 212  function lmb_substr_count($haystack, $needle)
 213  {
 214    return $GLOBALS['LIMB_CHARSET_DRIVER']->_substr_count($haystack, $needle);
 215  }
 216  /**

 217   * @deprecated

 218   */
 219  function _substr_count($haystack, $needle)
 220  {
 221    return $GLOBALS['LIMB_CHARSET_DRIVER']->_substr_count($haystack, $needle);
 222  }
 223  /**

 224   * Multibyte aware replacement for str_split

 225   */
 226  function lmb_str_split($str, $split_len=1)
 227  {
 228    return $GLOBALS['LIMB_CHARSET_DRIVER']->_str_split($strX, $strY);
 229  }
 230  /**

 231   * @deprecated

 232   */
 233  function _str_split($str, $split_len=1)
 234  {
 235    return $GLOBALS['LIMB_CHARSET_DRIVER']->_str_split($strX, $strY);
 236  }
 237  /**

 238   * This is multibyte aware alternative to preg_match

 239   */
 240  function lmb_preg_match($pattern, $subject, &$matches, $flags=null, $offset=null)
 241  {
 242    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_match($pattern, $subject, $matches, $flags, $offset);
 243  }
 244  /**

 245   * @deprecated

 246   */
 247  function _preg_match($pattern, $subject, &$matches, $flags=null, $offset=null)
 248  {
 249    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_match($pattern, $subject, $matches, $flags, $offset);
 250  }
 251  /**

 252   * This is multibyte aware alternative to preg_match_all

 253   */
 254  function lmb_preg_match_all($pattern, $subject, &$matches, $flags=null, $offset=null)
 255  {
 256    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_match_all($pattern, $subject, $matches, $flags, $offset);
 257  }
 258  /**

 259   * @deprecated

 260   */
 261  function _preg_match_all($pattern, $subject, &$matches, $flags=null, $offset=null)
 262  {
 263    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_match_all($pattern, $subject, $matches, $flags, $offset);
 264  }
 265  /**

 266   * This is multibyte aware alternative to preg_replace

 267   */
 268  function lmb_preg_replace($pattern, $replacement, $subject, $limit=null)
 269  {
 270    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_replace($pattern, $replacement, $subject, $limit);
 271  }
 272  /**

 273   * @deprecated

 274   */
 275  function _preg_replace($pattern, $replacement, $subject, $limit=null)
 276  {
 277    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_replace($pattern, $replacement, $subject, $limit);
 278  }
 279  /**

 280   * This is multibyte aware alternative to preg_replace_callback

 281   */
 282  function lmb_preg_replace_callback($pattern, $callback, $subject, $limit=null)
 283  {
 284    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_replace_callback($pattern, $callback, $subject, $limit);
 285  }
 286  /**

 287   * @deprecated

 288   */
 289  function _preg_replace_callback($pattern, $callback, $subject, $limit=null)
 290  {
 291    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_replace_callback($pattern, $callback, $subject, $limit);
 292  }
 293  /**

 294   * This is multibyte aware alternative to preg_split

 295   */
 296  function lmb_preg_split($pattern, $subject, $limit=null, $flags=null)
 297  {
 298    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_split($pattern, $subject, $limit, $flags);
 299  }
 300  /**

 301   * @deprecated

 302   */
 303  function _preg_split($pattern, $subject, $limit=null, $flags=null)
 304  {
 305    return $GLOBALS['LIMB_CHARSET_DRIVER']->_preg_split($pattern, $subject, $limit, $flags);
 306  }


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7