mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update Zend_Locale_Format to the latest Zend version
This commit is contained in:
parent
824c6067a2
commit
85d2a16ad6
16
thirdparty/Zend/Locale/Format.php
vendored
16
thirdparty/Zend/Locale/Format.php
vendored
@ -15,8 +15,8 @@
|
||||
* @category Zend
|
||||
* @package Zend_Locale
|
||||
* @subpackage Format
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Format.php 23775 2011-03-01 17:25:24Z ralph $
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id$
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Locale/Data.php';
|
||||
* @category Zend
|
||||
* @package Zend_Locale
|
||||
* @subpackage Format
|
||||
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Locale_Format
|
||||
@ -99,8 +99,9 @@ class Zend_Locale_Format
|
||||
$options['number_format'] = Zend_Locale_Data::getContent($locale, 'decimalnumber');
|
||||
} else if ((gettype($value) !== 'string') and ($value !== NULL)) {
|
||||
require_once 'Zend/Locale/Exception.php';
|
||||
$stringValue = (string)(is_array($value) ? implode(' ', $value) : $value);
|
||||
throw new Zend_Locale_Exception("Unknown number format type '" . gettype($value) . "'. "
|
||||
. "Format '$value' must be a valid number format string.");
|
||||
. "Format '$stringValue' must be a valid number format string.");
|
||||
}
|
||||
break;
|
||||
|
||||
@ -113,8 +114,9 @@ class Zend_Locale_Format
|
||||
$options['date_format'] = Zend_Locale_Format::getDateFormat($locale);
|
||||
} else if ((gettype($value) !== 'string') and ($value !== NULL)) {
|
||||
require_once 'Zend/Locale/Exception.php';
|
||||
$stringValue = (string)(is_array($value) ? implode(' ', $value) : $value);
|
||||
throw new Zend_Locale_Exception("Unknown dateformat type '" . gettype($value) . "'. "
|
||||
. "Format '$value' must be a valid ISO or PHP date format string.");
|
||||
. "Format '$stringValue' must be a valid ISO or PHP date format string.");
|
||||
} else {
|
||||
if (((isset($options['format_type']) === true) and ($options['format_type'] == 'php')) or
|
||||
((isset($options['format_type']) === false) and (self::$_options['format_type'] == 'php'))) {
|
||||
@ -300,8 +302,8 @@ class Zend_Locale_Format
|
||||
// load class within method for speed
|
||||
require_once 'Zend/Locale/Math.php';
|
||||
|
||||
$value = Zend_Locale_Math::normalize($value);
|
||||
$value = Zend_Locale_Math::floatalize($value);
|
||||
$value = Zend_Locale_Math::normalize($value);
|
||||
$options = self::_checkOptions($options) + self::$_options;
|
||||
$options['locale'] = (string) $options['locale'];
|
||||
|
||||
@ -1137,7 +1139,7 @@ class Zend_Locale_Format
|
||||
|
||||
if (empty($options['date_format'])) {
|
||||
$options['format_type'] = 'iso';
|
||||
$options['date_format'] = self::getDateFormat($options['locale']);
|
||||
$options['date_format'] = self::getDateFormat(isset($options['locale']) ? $options['locale'] : null);
|
||||
}
|
||||
$options = self::_checkOptions($options) + self::$_options;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user