~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/Measure/Volume.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Zend Framework
 
4
 *
 
5
 * LICENSE
 
6
 *
 
7
 * This source file is subject to the new BSD license that is bundled
 
8
 * with this package in the file LICENSE.txt.
 
9
 * It is also available through the world-wide-web at this URL:
 
10
 * http://framework.zend.com/license/new-bsd
 
11
 * If you did not receive a copy of the license and are unable to
 
12
 * obtain it through the world-wide-web, please send an email
 
13
 * to license@zend.com so we can send you a copy immediately.
 
14
 *
 
15
 * @category  Zend
 
16
 * @package   Zend_Measure
 
17
 * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
18
 * @license   http://framework.zend.com/license/new-bsd     New BSD License
 
19
 * @version   $Id: Volume.php 9508 2008-05-23 10:56:41Z thomas $
 
20
 */
 
21
 
 
22
/**
 
23
 * Implement needed classes
 
24
 */
 
25
require_once 'Zend/Measure/Exception.php';
 
26
require_once 'Zend/Measure/Abstract.php';
 
27
require_once 'Zend/Locale.php';
 
28
 
 
29
/**
 
30
 * Class for handling acceleration conversions
 
31
 *
 
32
 * @category   Zend
 
33
 * @package    Zend_Measure
 
34
 * @subpackage Zend_Measure_Volume
 
35
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 
36
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 
37
 */
 
38
class Zend_Measure_Volume extends Zend_Measure_Abstract
 
39
{
 
40
    const STANDARD = 'CUBIC_METER';
 
41
 
 
42
    const ACRE_FOOT           = 'ACRE_FOOT';
 
43
    const ACRE_FOOT_SURVEY    = 'ACRE_FOOT_SURVEY';
 
44
    const ACRE_INCH           = 'ACRE_INCH';
 
45
    const BARREL_WINE         = 'BARREL_WINE';
 
46
    const BARREL              = 'BARREL';
 
47
    const BARREL_US_DRY       = 'BARREL_US_DRY';
 
48
    const BARREL_US_FEDERAL   = 'BARREL_US_FEDERAL';
 
49
    const BARREL_US           = 'BARREL_US';
 
50
    const BARREL_US_PETROLEUM = 'BARREL_US_PETROLEUM';
 
51
    const BOARD_FOOT          = 'BOARD_FOOT';
 
52
    const BUCKET              = 'BUCKET';
 
53
    const BUCKET_US           = 'BUCKET_US';
 
54
    const BUSHEL              = 'BUSHEL';
 
55
    const BUSHEL_US           = 'BUSHEL_US';
 
56
    const CENTILTER           = 'CENTILITER';
 
57
    const CORD                = 'CORD';
 
58
    const CORD_FOOT           = 'CORD_FOOT';
 
59
    const CUBIC_CENTIMETER    = 'CUBIC_CENTIMETER';
 
60
    const CUBIC_CUBIT         = 'CUBIC_CUBIT';
 
61
    const CUBIC_DECIMETER     = 'CUBIC_DECIMETER';
 
62
    const CUBIC_DEKAMETER     = 'CUBIC_DEKAMETER';
 
63
    const CUBIC_FOOT          = 'CUBIC_FOOT';
 
64
    const CUBIC_INCH          = 'CUBIC_INCH';
 
65
    const CUBIC_KILOMETER     = 'CUBIC_KILOMETER';
 
66
    const CUBIC_METER         = 'CUBIC_METER';
 
67
    const CUBIC_MILE          = 'CUBIC_MILE';
 
68
    const CUBIC_MICROMETER    = 'CUBIC_MICROMETER';
 
69
    const CUBIC_MILLIMETER    = 'CUBIC_MILLIMETER';
 
70
    const CUBIC_YARD          = 'CUBIC_YARD';
 
71
    const CUP_CANADA          = 'CUP_CANADA';
 
72
    const CUP                 = 'CUP';
 
73
    const CUP_US              = 'CUP_US';
 
74
    const DECILITER           = 'DECILITER';
 
75
    const DEKALITER           = 'DEKALITER';
 
76
    const DRAM                = 'DRAM';
 
77
    const DRUM_US             = 'DRUM_US';
 
78
    const DRUM                = 'DRUM';
 
79
    const FIFTH               = 'FIFTH';
 
80
    const GALLON              = 'GALLON';
 
81
    const GALLON_US_DRY       = 'GALLON_US_DRY';
 
82
    const GALLON_US           = 'GALLON_US';
 
83
    const GILL                = 'GILL';
 
84
    const GILL_US             = 'GILL_US';
 
85
    const HECTARE_METER       = 'HECTARE_METER';
 
86
    const HECTOLITER          = 'HECTOLITER';
 
87
    const HOGSHEAD            = 'HOGSHEAD';
 
88
    const HOGSHEAD_US         = 'HOGSHEAD_US';
 
89
    const JIGGER              = 'JIGGER';
 
90
    const KILOLITER           = 'KILOLITER';
 
91
    const LITER               = 'LITER';
 
92
    const MEASURE             = 'MEASURE';
 
93
    const MEGALITER           = 'MEGALITER';
 
94
    const MICROLITER          = 'MICROLITER';
 
95
    const MILLILITER          = 'MILLILITER';
 
96
    const MINIM               = 'MINIM';
 
97
    const MINIM_US            = 'MINIM_US';
 
98
    const OUNCE               = 'OUNCE';
 
99
    const OUNCE_US            = 'OUNCE_US';
 
100
    const PECK                = 'PECK';
 
101
    const PECK_US             = 'PECK_US';
 
102
    const PINT                = 'PINT';
 
103
    const PINT_US_DRY         = 'PINT_US_DRY';
 
104
    const PINT_US             = 'PINT_US';
 
105
    const PIPE                = 'PIPE';
 
106
    const PIPE_US             = 'PIPE_US';
 
107
    const PONY                = 'PONY';
 
108
    const QUART_GERMANY       = 'QUART_GERMANY';
 
109
    const QUART_ANCIENT       = 'QUART_ANCIENT';
 
110
    const QUART               = 'QUART';
 
111
    const QUART_US_DRY        = 'QUART_US_DRY';
 
112
    const QUART_US            = 'QUART_US';
 
113
    const QUART_UK            = 'QUART_UK';
 
114
    const SHOT                = 'SHOT';
 
115
    const STERE               = 'STERE';
 
116
    const TABLESPOON          = 'TABLESPOON';
 
117
    const TABLESPOON_UK       = 'TABLESPOON_UK';
 
118
    const TABLESPOON_US       = 'TABLESPOON_US';
 
119
    const TEASPOON            = 'TEASPOON';
 
120
    const TEASPOON_UK         = 'TEASPOON_UK';
 
121
    const TEASPOON_US         = 'TEASPOON_US';
 
122
    const YARD                = 'YARD';
 
123
 
 
124
    /**
 
125
     * Calculations for all volume units
 
126
     *
 
127
     * @var array
 
128
     */
 
129
    protected $_units = array(
 
130
        'ACRE_FOOT'           => array('1233.48185532', 'ac ft'),
 
131
        'ACRE_FOOT_SURVEY'    => array('1233.489',      'ac ft'),
 
132
        'ACRE_INCH'           => array('102.79015461',  'ac in'),
 
133
        'BARREL_WINE'         => array('0.143201835',   'bbl'),
 
134
        'BARREL'              => array('0.16365924',    'bbl'),
 
135
        'BARREL_US_DRY'       => array(array('' => '26.7098656608', '/' => '231'), 'bbl'),
 
136
        'BARREL_US_FEDERAL'   => array('0.1173477658',  'bbl'),
 
137
        'BARREL_US'           => array('0.1192404717',  'bbl'),
 
138
        'BARREL_US_PETROLEUM' => array('0.1589872956',  'bbl'),
 
139
        'BOARD_FOOT'          => array(array('' => '6.5411915904', '/' => '2772'), 'board foot'),
 
140
        'BUCKET'              => array('0.01818436',    'bucket'),
 
141
        'BUCKET_US'           => array('0.018927059',   'bucket'),
 
142
        'BUSHEL'              => array('0.03636872',    'bu'),
 
143
        'BUSHEL_US'           => array('0.03523907',    'bu'),
 
144
        'CENTILITER'          => array('0.00001',       'cl'),
 
145
        'CORD'                => array('3.624556416',   'cd'),
 
146
        'CORD_FOOT'           => array('0.453069552',   'cd ft'),
 
147
        'CUBIC_CENTIMETER'    => array('0.000001',      'cm³'),
 
148
        'CUBIC_CUBIT'         => array('0.144',         'cubit³'),
 
149
        'CUBIC_DECIMETER'     => array('0.001',         'dm³'),
 
150
        'CUBIC_DEKAMETER'     => array('1000',          'dam³'),
 
151
        'CUBIC_FOOT'          => array(array('' => '6.54119159', '/' => '231'),   'ft³'),
 
152
        'CUBIC_INCH'          => array(array('' => '0.0037854118', '/' => '231'), 'in³'),
 
153
        'CUBIC_KILOMETER'     => array('1.0e+9',        'km³'),
 
154
        'CUBIC_METER'         => array('1',             'm³'),
 
155
        'CUBIC_MILE'          => array(array('' => '0.0037854118', '/' => '231', '*' => '75271680', '*' => '3379200'),
 
156
                                       'mi³'),
 
157
        'CUBIC_MICROMETER'    => array('1.0e-18',       'µm³'),
 
158
        'CUBIC_MILLIMETER'    => array('1.0e-9',        'mm³'),
 
159
        'CUBIC_YARD'          => array(array('' => '0.0037854118', '/' => '231', '*' => '46656'), 'yd³'),
 
160
        'CUP_CANADA'          => array('0.0002273045',  'c'),
 
161
        'CUP'                 => array('0.00025',       'c'),
 
162
        'CUP_US'              => array(array('' => '0.0037854118', '/' => '16'), 'c'),
 
163
        'DECILITER'           => array('0.0001',        'dl'),
 
164
        'DEKALITER'           => array('0.001',         'dal'),
 
165
        'DRAM'                => array(array('' => '0.0037854118', '/' => '1024'), 'dr'),
 
166
        'DRUM_US'             => array('0.208197649',   'drum'),
 
167
        'DRUM'                => array('0.2',           'drum'),
 
168
        'FIFTH'               => array('0.00075708236', 'fifth'),
 
169
        'GALLON'              => array('0.00454609',    'gal'),
 
170
        'GALLON_US_DRY'       => array('0.0044048838',  'gal'),
 
171
        'GALLON_US'           => array('0.0037854118',  'gal'),
 
172
        'GILL'                => array(array('' => '0.00454609', '/' => '32'),   'gi'),
 
173
        'GILL_US'             => array(array('' => '0.0037854118', '/' => '32'), 'gi'),
 
174
        'HECTARE_METER'       => array('10000',         'ha m'),
 
175
        'HECTOLITER'          => array('0.1',           'hl'),
 
176
        'HOGSHEAD'            => array('0.28640367',    'hhd'),
 
177
        'HOGSHEAD_US'         => array('0.2384809434',  'hhd'),
 
178
        'JIGGER'              => array(array('' => '0.0037854118', '/' => '128', '*' => '1.5'), 'jigger'),
 
179
        'KILOLITER'           => array('1',             'kl'),
 
180
        'LITER'               => array('0.001',         'l'),
 
181
        'MEASURE'             => array('0.0077',        'measure'),
 
182
        'MEGALITER'           => array('1000',          'Ml'),
 
183
        'MICROLITER'          => array('1.0e-9',        'µl'),
 
184
        'MILLILITER'          => array('0.000001',      'ml'),
 
185
        'MINIM'               => array(array('' => '0.00454609', '/' => '76800'),  'min'),
 
186
        'MINIM_US'            => array(array('' => '0.0037854118','/' => '61440'), 'min'),
 
187
        'OUNCE'               => array(array('' => '0.00454609', '/' => '160'),    'oz'),
 
188
        'OUNCE_US'            => array(array('' => '0.0037854118', '/' => '128'),  'oz'),
 
189
        'PECK'                => array('0.00909218',    'pk'),
 
190
        'PECK_US'             => array('0.0088097676',  'pk'),
 
191
        'PINT'                => array(array('' => '0.00454609', '/' => '8'),   'pt'),
 
192
        'PINT_US_DRY'         => array(array('' => '0.0044048838', '/' => '8'), 'pt'),
 
193
        'PINT_US'             => array(array('' => '0.0037854118', '/' => '8'), 'pt'),
 
194
        'PIPE'                => array('0.49097772',    'pipe'),
 
195
        'PIPE_US'             => array('0.4769618868',  'pipe'),
 
196
        'PONY'                => array(array('' => '0.0037854118', '/' => '128'), 'pony'),
 
197
        'QUART_GERMANY'       => array('0.00114504',    'qt'),
 
198
        'QUART_ANCIENT'       => array('0.00108',       'qt'),
 
199
        'QUART'               => array(array('' => '0.00454609', '/' => '4'),   'qt'),
 
200
        'QUART_US_DRY'        => array(array('' => '0.0044048838', '/' => '4'), 'qt'),
 
201
        'QUART_US'            => array(array('' => '0.0037854118', '/' => '4'), 'qt'),
 
202
        'QUART_UK'            => array('0.29094976',    'qt'),
 
203
        'SHOT'                => array(array('' => '0.0037854118', '/' => '128'), 'shot'),
 
204
        'STERE'               => array('1',             'st'),
 
205
        'TABLESPOON'          => array('0.000015',      'tbsp'),
 
206
        'TABLESPOON_UK'       => array(array('' => '0.00454609', '/' => '320'),   'tbsp'),
 
207
        'TABLESPOON_US'       => array(array('' => '0.0037854118', '/' => '256'), 'tbsp'),
 
208
        'TEASPOON'            => array('0.000005',      'tsp'),
 
209
        'TEASPOON_UK'         => array(array('' => '0.00454609', '/' => '1280'),    'tsp'),
 
210
        'TEASPOON_US'         => array(array('' => '0.0037854118', '/' => '768'),   'tsp'),
 
211
        'YARD'                => array(array('' => '176.6121729408', '/' => '231'), 'yd'),
 
212
        'STANDARD'            => 'CUBIC_METER'
 
213
    );
 
214
}