import v1.1.0_RC2 | 2009-09-20

This commit is contained in:
2019-07-17 22:19:00 +02:00
parent 3b7ba80568
commit 38c146901c
2504 changed files with 101817 additions and 62316 deletions

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 12060 2008-10-21 17:23:55Z thomas $
* @version $Id: Abstract.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -40,7 +40,7 @@ require_once 'Zend/Locale/Format.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Abstract
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Measure_Abstract
@ -86,6 +86,38 @@ abstract class Zend_Measure_Abstract
$type = null;
}
$this->setLocale($locale);
if ($type === null) {
$type = $this->_units['STANDARD'];
}
if (isset($this->_units[$type]) === false) {
require_once 'Zend/Measure/Exception.php';
throw new Zend_Measure_Exception("Type ($type) is unknown");
}
$this->setValue($value, $type, $this->_locale);
}
/**
* Returns the actual set locale
*
* @return string
*/
public function getLocale()
{
return $this->_locale;
}
/**
* Sets a new locale for the value representation
*
* @param string|Zend_Locale $locale (Optional) New locale to set
* @param boolean $check False, check but don't set; True, set the new locale
* @return Zend_Measure_Abstract
*/
public function setLocale($locale = null, $check = false)
{
if (empty($locale)) {
require_once 'Zend/Registry.php';
if (Zend_Registry::isRegistered('Zend_Locale') === true) {
@ -106,33 +138,33 @@ abstract class Zend_Measure_Abstract
$locale = new Zend_Locale($locale);
}
$this->_locale = (string) $locale;
if ($type === null) {
$type = $this->_units['STANDARD'];
if (!$check) {
$this->_locale = (string) $locale;
}
if (isset($this->_units[$type]) === false) {
require_once 'Zend/Measure/Exception.php';
throw new Zend_Measure_Exception("Type ($type) is unknown");
}
$this->setValue($value, $type, $this->_locale);
return $this;
}
/**
* Returns the internal value
*
* @param integer $round (Optional) Rounds the value to an given precision,
* Default is 2, -1 returns without rounding
* @param integer $round (Optional) Rounds the value to an given precision,
* Default is -1 which returns without rounding
* @param string|Zend_Locale $locale (Optional) Locale for number representation
*/
public function getValue($round = 2)
public function getValue($round = -1, $locale = null)
{
if ($round < 0) {
return $this->_value;
$return = $this->_value;
} else {
$return = Zend_Locale_Math::round($this->_value, $round);
}
return Zend_Locale_Math::round($this->_value, $round);
if ($locale !== null) {
$this->setLocale($locale, true);
return Zend_Locale_Format::toNumber($return, array('locale' => $locale));
}
return $return;
}
/**
@ -154,16 +186,7 @@ abstract class Zend_Measure_Abstract
$locale = $this->_locale;
}
if (!Zend_Locale::isLocale($locale, true, false)) {
if (!Zend_Locale::isLocale($locale, false, false)) {
require_once 'Zend/Measure/Exception.php';
throw new Zend_Measure_Exception("Language (" . (string) $locale . ") is unknown");
}
$locale = new Zend_Locale($locale);
}
$locale = (string) $locale;
$this->setLocale($locale, true);
if ($type === null) {
$type = $this->_units['STANDARD'];
}
@ -182,6 +205,7 @@ abstract class Zend_Measure_Abstract
$this->_value = $value;
$this->setType($type);
return $this;
}
/**
@ -212,7 +236,12 @@ abstract class Zend_Measure_Abstract
} else {
// Convert to standard value
$value = $this->getValue(-1);
$value = $this->_value;
$prec = 0;
if (strpos($this->_value, '.') !== false) {
$prec = strlen(substr($this->_value, strpos($this->_value, '.') + 1));
}
if (is_array($this->_units[$this->getType()][0])) {
foreach ($this->_units[$this->getType()][0] as $key => $found) {
switch ($key) {
@ -235,7 +264,7 @@ abstract class Zend_Measure_Abstract
} else {
$value = call_user_func(Zend_Locale_Math::$mul, $value, $this->_units[$this->getType()][0], 25);
}
// Convert to expected value
if (is_array($this->_units[$type][0])) {
foreach (array_reverse($this->_units[$type][0]) as $key => $found) {
@ -260,9 +289,10 @@ abstract class Zend_Measure_Abstract
$value = @call_user_func(Zend_Locale_Math::$div, $value, $this->_units[$type][0], 25);
}
$this->_value = $value;
$this->_value = Zend_Locale_Math::round($value, $prec);
$this->_type = $type;
}
return $this;
}
/**
@ -283,12 +313,17 @@ abstract class Zend_Measure_Abstract
/**
* Returns a string representation
*
* @param integer $round OPTIONAL rounds the value to an given exception
* @param integer $round (Optional) Runds the value to an given exception
* @param string|Zend_Locale $locale (Optional) Locale to set for the number
* @return string
*/
public function toString($round = -1)
public function toString($round = -1, $locale = null)
{
return $this->getValue($round) . ' ' . $this->_units[$this->getType()][1];
if ($locale === null) {
$locale = $this->_locale;
}
return $this->getValue($round, $locale) . ' ' . $this->_units[$this->getType()][1];
}
/**
@ -314,14 +349,15 @@ abstract class Zend_Measure_Abstract
/**
* Alias function for setType returning the converted unit
*
* @param $type type
* @param $round integer OPTIONAL rounds the value to a given precision
* @param string $type Constant Type
* @param integer $round (Optional) Rounds the value to a given precision
* @param string|Zend_Locale $locale (Optional) Locale to set for the number
* @return string
*/
public function convertTo($type, $round = 2)
public function convertTo($type, $round = 2, $locale = null)
{
$this->setType($type);
return $this->toString($round);
return $this->toString($round, $locale);
}
/**

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Acceleration.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Acceleration.php 16220 2009-06-21 19:49:21Z thomas $
*/
@ -32,7 +32,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Acceleration
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Acceleration extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Angle.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Angle.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Angle
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Angle extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Area.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Area.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Area
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Area extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Binary.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Binary.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Binary
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Binary extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Capacitance.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Capacitance.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Capacitance
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Capacitance extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Volume.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Volume.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Cooking_Volume
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Cooking_Volume extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Weight.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Weight.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Cooking_Weight
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Cooking_Weight extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Current.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Current.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Current
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Current extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Density.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Density.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Density
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Density extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Energy.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Energy.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Energy
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Energy extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 9508 2008-05-23 10:56:41Z thomas $
* @version $Id: Exception.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Exception extends Zend_Exception

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Mass.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Mass.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Flow_Mass
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Flow_Mass extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Mole.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Mole.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Flow_Mole
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Flow_Mole extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Volume.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Volume.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Flow_Volume
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Flow_Volume extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Force.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Force.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Force
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Force extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Frequency.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Frequency.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Frequency
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Frequency extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Illumination.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Illumination.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Illumination
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Illumination extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Length.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Length.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Length
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Length extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Lightness.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Lightness.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Lightness
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Lightness extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Number.php 12514 2008-11-10 16:30:24Z matthew $
* @version $Id: Number.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -33,7 +33,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Number
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Number extends Zend_Measure_Abstract
@ -76,7 +76,7 @@ class Zend_Measure_Number extends Zend_Measure_Abstract
/**
* Definition of all roman signs
*
*
* @var array $_roman
*/
private static $_roman = array(
@ -109,7 +109,7 @@ class Zend_Measure_Number extends Zend_Measure_Abstract
/**
* Convertion table for roman signs
*
*
* @var array $_romanconvert
*/
private static $_romanconvert = array(
@ -336,7 +336,7 @@ class Zend_Measure_Number extends Zend_Measure_Abstract
$target = call_user_func(Zend_Locale_Math::$mod, $value, $base);
$newvalue = strtoupper(dechex($target)) . $newvalue;
$value = call_user_func(Zend_Locale_Math::$sub, $value, $target, 0);
$value = call_user_func(Zend_Locale_Math::$div, $value, $base, 0);
@ -346,7 +346,7 @@ class Zend_Measure_Number extends Zend_Measure_Abstract
throw new Zend_Measure_Exception("Your value '$tempvalue' cannot be processed because it extends 200 digits");
}
}
if ($newvalue === '') {
$newvalue = '0';
}
@ -412,9 +412,9 @@ class Zend_Measure_Number extends Zend_Measure_Abstract
* @param integer $round (Optional) Precision to add, will always be 0
* @return string
*/
public function convertTo($type, $round = 0)
public function convertTo($type, $round = 0, $locale = null)
{
$this->setType($type);
return $this->toString($round);
return $this->toString($round, $locale);
}
}

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Power.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Power.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Power
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Power extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Pressure.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Pressure.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Pressure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Pressure extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Speed.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Speed.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Speed
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Speed extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Temperature.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Temperature.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Temperature
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Temperature extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: $
* @version $Id: Time.php 16971 2009-07-22 18:05:45Z mikaelkael $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Time
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Time extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Torque.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Torque.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Torque
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Torque extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Dynamic.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Dynamic.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Viscosity_Dynamic
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Viscosity_Dynamic extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Kinematic.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Kinematic.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Viscosity_Kinematic
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Viscosity_Kinematic extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Volume.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Volume.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Volume
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Volume extends Zend_Measure_Abstract

View File

@ -14,9 +14,9 @@
*
* @category Zend
* @package Zend_Measure
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Weight.php 13209 2008-12-13 22:34:06Z thomas $
* @version $Id: Weight.php 16220 2009-06-21 19:49:21Z thomas $
*/
/**
@ -31,7 +31,7 @@ require_once 'Zend/Locale.php';
* @category Zend
* @package Zend_Measure
* @subpackage Zend_Measure_Weigth
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Measure_Weight extends Zend_Measure_Abstract