1 <?php 2 /** 3 * Copyright 2010-2017 Horde LLC (http://www.horde.org/) 4 * 5 * @author Chuck Hagenbuch <chuck@horde.org> 6 * @license http://www.horde.org/licenses/bsd BSD 7 * @category Horde 8 * @package Support 9 */ 10 11 /** 12 * @author Chuck Hagenbuch <chuck@horde.org> 13 * @license http://www.horde.org/licenses/bsd BSD 14 * @category Horde 15 * @package Support 16 */ 17 class Horde_Support_Numerizer 18 { 19 public static function numerize($string, $args = array()) 20 { 21 return self::factory($args)->numerize($string); 22 } 23 24 public static function factory($args = array()) 25 { 26 $locale = isset($args['locale']) ? $args['locale'] : null; 27 if ($locale && Horde_String::lower($locale) != 'base') { 28 $locale = str_replace(' ', '_', Horde_String::ucwords(str_replace('_', ' ', Horde_String::lower($locale)))); 29 $class = 'Horde_Support_Numerizer_Locale_' . $locale; 30 if (class_exists($class)) { 31 return new $class($args); 32 } 33 34 list($language,) = explode('_', $locale); 35 if ($language != $locale) { 36 $class = 'Horde_Support_Numerizer_Locale_' . $language; 37 if (class_exists($class)) { 38 return new $class($args); 39 } 40 } 41 } 42 43 return new Horde_Support_Numerizer_Locale_Base($args); 44 } 45 46 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body