PageRenderTime 69ms CodeModel.GetById 2ms app.highlight 55ms RepoModel.GetById 1ms app.codeStats 1ms

/vendor/Eva/Locale/Data.php

https://github.com/zc1415926/eva-engine
PHP | 1496 lines | 1133 code | 180 blank | 183 comment | 161 complexity | 01a87f4610a1c06f4adb5f1379b5ddc3 MD5 | raw file
   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_Locale
  17 * @subpackage Data
  18 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
  20 * @version    $Id: Data.php 24140 2011-06-14 02:11:19Z adamlundrigan $
  21 */
  22
  23
  24 namespace Eva\Locale;
  25
  26/**
  27 * Locale data reader, handles the CLDR
  28 *
  29 * @category   Zend
  30 * @package    Zend_Locale
  31 * @subpackage Data
  32 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  33 * @license    http://framework.zend.com/license/new-bsd     New BSD License
  34 */
  35class Data
  36{
  37    /**
  38     * Locale files
  39     *
  40     * @var ressource
  41     * @access private
  42     */
  43    private static $_ldml = array();
  44
  45    /**
  46     * List of values which are collected
  47     *
  48     * @var array
  49     * @access private
  50     */
  51    private static $_list = array();
  52
  53    /**
  54     * Internal cache for ldml values
  55     *
  56     * @var Zend_Cache_Core
  57     * @access private
  58     */
  59    private static $_cache = null;
  60
  61    /**
  62     * Internal value to remember if cache supports tags
  63     *
  64     * @var boolean
  65     */
  66    private static $_cacheTags = false;
  67
  68    /**
  69     * Internal option, cache disabled
  70     *
  71     * @var    boolean
  72     * @access private
  73     */
  74    private static $_cacheDisabled = true;
  75
  76    /**
  77     * Read the content from locale
  78     *
  79     * Can be called like:
  80     * <ldml>
  81     *     <delimiter>test</delimiter>
  82     *     <second type='myone'>content</second>
  83     *     <second type='mysecond'>content2</second>
  84     *     <third type='mythird' />
  85     * </ldml>
  86     *
  87     * Case 1: _readFile('ar','/ldml/delimiter')             -> returns [] = test
  88     * Case 1: _readFile('ar','/ldml/second[@type=myone]')   -> returns [] = content
  89     * Case 2: _readFile('ar','/ldml/second','type')         -> returns [myone] = content; [mysecond] = content2
  90     * Case 3: _readFile('ar','/ldml/delimiter',,'right')    -> returns [right] = test
  91     * Case 4: _readFile('ar','/ldml/third','type','myone')  -> returns [myone] = mythird
  92     *
  93     * @param  string $locale
  94     * @param  string $path
  95     * @param  string $attribute
  96     * @param  string $value
  97     * @access private
  98     * @return array
  99     */
 100    private static function _readFile($locale, $path, $attribute, $value, $temp)
 101    {
 102        // without attribute - read all values
 103        // with attribute    - read only this value
 104        if (!empty(self::$_ldml[(string) $locale])) {
 105
 106            $result = self::$_ldml[(string) $locale]->xpath($path);
 107            if (!empty($result)) {
 108                foreach ($result as &$found) {
 109
 110                    if (empty($value)) {
 111
 112                        if (empty($attribute)) {
 113                            // Case 1
 114                            $temp[] = (string) $found;
 115                        } else if (empty($temp[(string) $found[$attribute]])){
 116                            // Case 2
 117                            $temp[(string) $found[$attribute]] = (string) $found;
 118                        }
 119
 120                    } else if (empty ($temp[$value])) {
 121
 122                        if (empty($attribute)) {
 123                            // Case 3
 124                            $temp[$value] = (string) $found;
 125                        } else {
 126                            // Case 4
 127                            $temp[$value] = (string) $found[$attribute];
 128                        }
 129
 130                    }
 131                }
 132            }
 133        }
 134        return $temp;
 135    }
 136
 137    /**
 138     * Find possible routing to other path or locale
 139     *
 140     * @param  string $locale
 141     * @param  string $path
 142     * @param  string $attribute
 143     * @param  string $value
 144     * @param  array  $temp
 145     * @throws Zend_Locale_Exception
 146     * @access private
 147     */
 148    private static function _findRoute($locale, $path, $attribute, $value, &$temp)
 149    {
 150        // load locale file if not already in cache
 151        // needed for alias tag when referring to other locale
 152        if (empty(self::$_ldml[(string) $locale])) {
 153            $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
 154            if (!file_exists($filename)) {
 155                require_once 'Zend/Locale/Exception.php';
 156                throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
 157            }
 158
 159            self::$_ldml[(string) $locale] = simplexml_load_file($filename);
 160        }
 161
 162        // search for 'alias' tag in the search path for redirection
 163        $search = '';
 164        $tok = strtok($path, '/');
 165
 166        // parse the complete path
 167        if (!empty(self::$_ldml[(string) $locale])) {
 168            while ($tok !== false) {
 169                $search .=  '/' . $tok;
 170                if (strpos($search, '[@') !== false) {
 171                    while (strrpos($search, '[@') > strrpos($search, ']')) {
 172                        $tok = strtok('/');
 173                        if (empty($tok)) {
 174                            $search .= '/';
 175                        }
 176                        $search = $search . '/' . $tok;
 177                    }
 178                }
 179                $result = self::$_ldml[(string) $locale]->xpath($search . '/alias');
 180
 181                // alias found
 182                if (!empty($result)) {
 183
 184                    $source = $result[0]['source'];
 185                    $newpath = $result[0]['path'];
 186
 187                    // new path - path //ldml is to ignore
 188                    if ($newpath != '//ldml') {
 189                        // other path - parse to make real path
 190
 191                        while (substr($newpath,0,3) == '../') {
 192                            $newpath = substr($newpath, 3);
 193                            $search = substr($search, 0, strrpos($search, '/'));
 194                        }
 195
 196                        // truncate ../ to realpath otherwise problems with alias
 197                        $path = $search . '/' . $newpath;
 198                        while (($tok = strtok('/'))!== false) {
 199                            $path = $path . '/' . $tok;
 200                        }
 201                    }
 202
 203                    // reroute to other locale
 204                    if ($source != 'locale') {
 205                        $locale = $source;
 206                    }
 207
 208                    $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
 209                    return false;
 210                }
 211
 212                $tok = strtok('/');
 213            }
 214        }
 215        return true;
 216    }
 217
 218    /**
 219     * Read the right LDML file
 220     *
 221     * @param  string $locale
 222     * @param  string $path
 223     * @param  string $attribute
 224     * @param  string $value
 225     * @access private
 226     */
 227    private static function _getFile($locale, $path, $attribute = false, $value = false, $temp = array())
 228    {
 229        $result = self::_findRoute($locale, $path, $attribute, $value, $temp);
 230        if ($result) {
 231            $temp = self::_readFile($locale, $path, $attribute, $value, $temp);
 232        }
 233
 234        // parse required locales reversive
 235        // example: when given zh_Hans_CN
 236        // 1. -> zh_Hans_CN
 237        // 2. -> zh_Hans
 238        // 3. -> zh
 239        // 4. -> root
 240        if (($locale != 'root') && ($result)) {
 241            $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
 242            if (!empty($locale)) {
 243                $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
 244            } else {
 245                $temp = self::_getFile('root', $path, $attribute, $value, $temp);
 246            }
 247        }
 248        return $temp;
 249    }
 250
 251    /**
 252     * Find the details for supplemental calendar datas
 253     *
 254     * @param  string $locale Locale for Detaildata
 255     * @param  array  $list   List to search
 256     * @return string         Key for Detaildata
 257     */
 258    private static function _calendarDetail($locale, $list)
 259    {
 260        $ret = "001";
 261        foreach ($list as $key => $value) {
 262            if (strpos($locale, '_') !== false) {
 263                $locale = substr($locale, strpos($locale, '_') + 1);
 264            }
 265            if (strpos($key, $locale) !== false) {
 266                $ret = $key;
 267                break;
 268            }
 269        }
 270        return $ret;
 271    }
 272
 273
 274    /**
 275     * Read the LDML file, get a array of multipath defined value
 276     *
 277     * @param  string $locale
 278     * @param  string $path
 279     * @param  string $value
 280     * @return array
 281     * @access public
 282     */
 283    public static function getList($locale, $path, $value = false)
 284    {
 285
 286        if (!isset(self::$_cache) && !self::$_cacheDisabled) {
 287            require_once 'Zend/Cache.php';
 288            self::$_cache = Zend_Cache::factory(
 289                'Core',
 290                'File',
 291                array('automatic_serialization' => true),
 292                array());
 293        }
 294
 295        $val = $value;
 296        if (is_array($value)) {
 297            $val = implode('_' , $value);
 298        }
 299
 300        $val = urlencode($val);
 301        $id = strtr('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val, array('-' => '_', '%' => '_', '+' => '_'));
 302        if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
 303            return unserialize($result);
 304        }
 305
 306        $temp = array();
 307        switch(strtolower($path)) {
 308            case 'language':
 309                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language', 'type');
 310                break;
 311
 312            case 'script':
 313                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script', 'type');
 314                break;
 315
 316            case 'territory':
 317                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory', 'type');
 318                if ($value === 1) {
 319                    foreach($temp as $key => $value) {
 320                        if ((is_numeric($key) === false) and ($key != 'QO') and ($key != 'QU')) {
 321                            unset($temp[$key]);
 322                        }
 323                    }
 324                } else if ($value === 2) {
 325                    foreach($temp as $key => $value) {
 326                        if (is_numeric($key) or ($key == 'QO') or ($key == 'QU')) {
 327                            unset($temp[$key]);
 328                        }
 329                    }
 330                }
 331                break;
 332
 333            case 'variant':
 334                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant', 'type');
 335                break;
 336
 337            case 'key':
 338                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/keys/key', 'type');
 339                break;
 340
 341            case 'type':
 342                if (empty($type)) {
 343                    $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type', 'type');
 344                } else {
 345                    if (($value == 'calendar') or
 346                        ($value == 'collation') or
 347                        ($value == 'currency')) {
 348                        $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@key=\'' . $value . '\']', 'type');
 349                    } else {
 350                        $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@type=\'' . $value . '\']', 'type');
 351                    }
 352                }
 353                break;
 354
 355            case 'layout':
 356                $temp  = self::_getFile($locale, '/ldml/layout/orientation',                 'lines',      'lines');
 357                $temp += self::_getFile($locale, '/ldml/layout/orientation',                 'characters', 'characters');
 358                $temp += self::_getFile($locale, '/ldml/layout/inList',                      '',           'inList');
 359                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'currency\']',  '',           'currency');
 360                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'dayWidth\']',  '',           'dayWidth');
 361                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'fields\']',    '',           'fields');
 362                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'keys\']',      '',           'keys');
 363                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'languages\']', '',           'languages');
 364                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'long\']',      '',           'long');
 365                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'measurementSystemNames\']', '', 'measurementSystemNames');
 366                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'monthWidth\']',   '',        'monthWidth');
 367                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'quarterWidth\']', '',        'quarterWidth');
 368                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'scripts\']',   '',           'scripts');
 369                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'territories\']',  '',        'territories');
 370                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'types\']',     '',           'types');
 371                $temp += self::_getFile($locale, '/ldml/layout/inText[@type=\'variants\']',  '',           'variants');
 372                break;
 373
 374            case 'characters':
 375                $temp  = self::_getFile($locale, '/ldml/characters/exemplarCharacters',                           '', 'characters');
 376                $temp += self::_getFile($locale, '/ldml/characters/exemplarCharacters[@type=\'auxiliary\']',      '', 'auxiliary');
 377                $temp += self::_getFile($locale, '/ldml/characters/exemplarCharacters[@type=\'currencySymbol\']', '', 'currencySymbol');
 378                break;
 379
 380            case 'delimiters':
 381                $temp  = self::_getFile($locale, '/ldml/delimiters/quotationStart',          '', 'quoteStart');
 382                $temp += self::_getFile($locale, '/ldml/delimiters/quotationEnd',            '', 'quoteEnd');
 383                $temp += self::_getFile($locale, '/ldml/delimiters/alternateQuotationStart', '', 'quoteStartAlt');
 384                $temp += self::_getFile($locale, '/ldml/delimiters/alternateQuotationEnd',   '', 'quoteEndAlt');
 385                break;
 386
 387            case 'measurement':
 388                $temp  = self::_getFile('supplementalData', '/supplementalData/measurementData/measurementSystem[@type=\'metric\']', 'territories', 'metric');
 389                $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/measurementSystem[@type=\'US\']',     'territories', 'US');
 390                $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/paperSize[@type=\'A4\']',             'territories', 'A4');
 391                $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/paperSize[@type=\'US-Letter\']',      'territories', 'US-Letter');
 392                break;
 393
 394            case 'months':
 395                if (empty($value)) {
 396                    $value = "gregorian";
 397                }
 398                $temp  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/default', 'choice', 'context');
 399                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/default', 'choice', 'default');
 400                $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'abbreviated\']/month', 'type');
 401                $temp['format']['narrow']      = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'narrow\']/month', 'type');
 402                $temp['format']['wide']        = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'wide\']/month', 'type');
 403                $temp['stand-alone']['abbreviated']  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'abbreviated\']/month', 'type');
 404                $temp['stand-alone']['narrow']       = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'narrow\']/month', 'type');
 405                $temp['stand-alone']['wide']         = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'wide\']/month', 'type');
 406                break;
 407
 408            case 'month':
 409                if (empty($value)) {
 410                    $value = array("gregorian", "format", "wide");
 411                }
 412                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month', 'type');
 413                break;
 414
 415            case 'days':
 416                if (empty($value)) {
 417                    $value = "gregorian";
 418                }
 419                $temp  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/default', 'choice', 'context');
 420                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/default', 'choice', 'default');
 421                $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'abbreviated\']/day', 'type');
 422                $temp['format']['narrow']      = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'narrow\']/day', 'type');
 423                $temp['format']['wide']        = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'wide\']/day', 'type');
 424                $temp['stand-alone']['abbreviated']  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'abbreviated\']/day', 'type');
 425                $temp['stand-alone']['narrow']       = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'narrow\']/day', 'type');
 426                $temp['stand-alone']['wide']         = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'wide\']/day', 'type');
 427                break;
 428
 429            case 'day':
 430                if (empty($value)) {
 431                    $value = array("gregorian", "format", "wide");
 432                }
 433                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/days/dayContext[@type=\'' . $value[1] . '\']/dayWidth[@type=\'' . $value[2] . '\']/day', 'type');
 434                break;
 435
 436            case 'week':
 437                $minDays   = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/minDays', 'territories'));
 438                $firstDay  = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/firstDay', 'territories'));
 439                $weekStart = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/weekendStart', 'territories'));
 440                $weekEnd   = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/weekendEnd', 'territories'));
 441
 442                $temp  = self::_getFile('supplementalData', "/supplementalData/weekData/minDays[@territories='" . $minDays . "']", 'count', 'minDays');
 443                $temp += self::_getFile('supplementalData', "/supplementalData/weekData/firstDay[@territories='" . $firstDay . "']", 'day', 'firstDay');
 444                $temp += self::_getFile('supplementalData', "/supplementalData/weekData/weekendStart[@territories='" . $weekStart . "']", 'day', 'weekendStart');
 445                $temp += self::_getFile('supplementalData', "/supplementalData/weekData/weekendEnd[@territories='" . $weekEnd . "']", 'day', 'weekendEnd');
 446                break;
 447
 448            case 'quarters':
 449                if (empty($value)) {
 450                    $value = "gregorian";
 451                }
 452                $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'abbreviated\']/quarter', 'type');
 453                $temp['format']['narrow']      = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'narrow\']/quarter', 'type');
 454                $temp['format']['wide']        = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'wide\']/quarter', 'type');
 455                $temp['stand-alone']['abbreviated']  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'abbreviated\']/quarter', 'type');
 456                $temp['stand-alone']['narrow']       = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'narrow\']/quarter', 'type');
 457                $temp['stand-alone']['wide']         = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'wide\']/quarter', 'type');
 458                break;
 459
 460            case 'quarter':
 461                if (empty($value)) {
 462                    $value = array("gregorian", "format", "wide");
 463                }
 464                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/quarters/quarterContext[@type=\'' . $value[1] . '\']/quarterWidth[@type=\'' . $value[2] . '\']/quarter', 'type');
 465                break;
 466
 467            case 'eras':
 468                if (empty($value)) {
 469                    $value = "gregorian";
 470                }
 471                $temp['names']       = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraNames/era', 'type');
 472                $temp['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraAbbr/era', 'type');
 473                $temp['narrow']      = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraNarrow/era', 'type');
 474                break;
 475
 476            case 'era':
 477                if (empty($value)) {
 478                    $value = array("gregorian", "Abbr");
 479                }
 480                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/eras/era' . $value[1] . '/era', 'type');
 481                break;
 482
 483            case 'date':
 484                if (empty($value)) {
 485                    $value = "gregorian";
 486                }
 487                $temp  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'full\']/dateFormat/pattern', '', 'full');
 488                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'long\']/dateFormat/pattern', '', 'long');
 489                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'medium\']/dateFormat/pattern', '', 'medium');
 490                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'short\']/dateFormat/pattern', '', 'short');
 491                break;
 492
 493            case 'time':
 494                if (empty($value)) {
 495                    $value = "gregorian";
 496                }
 497                $temp  = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'full\']/timeFormat/pattern', '', 'full');
 498                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'long\']/timeFormat/pattern', '', 'long');
 499                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'medium\']/timeFormat/pattern', '', 'medium');
 500                $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'short\']/timeFormat/pattern', '', 'short');
 501                break;
 502
 503            case 'datetime':
 504                if (empty($value)) {
 505                    $value = "gregorian";
 506                }
 507
 508                $timefull = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'full\']/timeFormat/pattern', '', 'full');
 509                $timelong = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'long\']/timeFormat/pattern', '', 'long');
 510                $timemedi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'medium\']/timeFormat/pattern', '', 'medi');
 511                $timeshor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'short\']/timeFormat/pattern', '', 'shor');
 512
 513                $datefull = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'full\']/dateFormat/pattern', '', 'full');
 514                $datelong = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'long\']/dateFormat/pattern', '', 'long');
 515                $datemedi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'medium\']/dateFormat/pattern', '', 'medi');
 516                $dateshor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'short\']/dateFormat/pattern', '', 'shor');
 517
 518                $full = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'full\']/dateTimeFormat/pattern', '', 'full');
 519                $long = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'long\']/dateTimeFormat/pattern', '', 'long');
 520                $medi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'medium\']/dateTimeFormat/pattern', '', 'medi');
 521                $shor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'short\']/dateTimeFormat/pattern', '', 'shor');
 522
 523                $temp['full']   = str_replace(array('{0}', '{1}'), array($timefull['full'], $datefull['full']), $full['full']);
 524                $temp['long']   = str_replace(array('{0}', '{1}'), array($timelong['long'], $datelong['long']), $long['long']);
 525                $temp['medium'] = str_replace(array('{0}', '{1}'), array($timemedi['medi'], $datemedi['medi']), $medi['medi']);
 526                $temp['short']  = str_replace(array('{0}', '{1}'), array($timeshor['shor'], $dateshor['shor']), $shor['shor']);
 527                break;
 528
 529            case 'dateitem':
 530                if (empty($value)) {
 531                    $value = "gregorian";
 532                }
 533                $_temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/availableFormats/dateFormatItem', 'id');
 534                foreach($_temp as $key => $found) {
 535                    $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/availableFormats/dateFormatItem[@id=\'' . $key . '\']', '', $key);
 536                }
 537                break;
 538
 539            case 'dateinterval':
 540                if (empty($value)) {
 541                    $value = "gregorian";
 542                }
 543                $_temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/intervalFormats/intervalFormatItem', 'id');
 544                foreach($_temp as $key => $found) {
 545                    $temp[$key] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/intervalFormats/intervalFormatItem[@id=\'' . $key . '\']/greatestDifference', 'id');
 546                }
 547                break;
 548
 549            case 'field':
 550                if (empty($value)) {
 551                    $value = "gregorian";
 552                }
 553                $temp2 = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/fields/field', 'type');
 554                foreach ($temp2 as $key => $keyvalue) {
 555                    $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/fields/field[@type=\'' . $key . '\']/displayName', '', $key);
 556                }
 557                break;
 558
 559            case 'relative':
 560                if (empty($value)) {
 561                    $value = "gregorian";
 562                }
 563                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/fields/field/relative', 'type');
 564                break;
 565
 566            case 'symbols':
 567                $temp  = self::_getFile($locale, '/ldml/numbers/symbols/decimal',         '', 'decimal');
 568                $temp += self::_getFile($locale, '/ldml/numbers/symbols/group',           '', 'group');
 569                $temp += self::_getFile($locale, '/ldml/numbers/symbols/list',            '', 'list');
 570                $temp += self::_getFile($locale, '/ldml/numbers/symbols/percentSign',     '', 'percent');
 571                $temp += self::_getFile($locale, '/ldml/numbers/symbols/nativeZeroDigit', '', 'zero');
 572                $temp += self::_getFile($locale, '/ldml/numbers/symbols/patternDigit',    '', 'pattern');
 573                $temp += self::_getFile($locale, '/ldml/numbers/symbols/plusSign',        '', 'plus');
 574                $temp += self::_getFile($locale, '/ldml/numbers/symbols/minusSign',       '', 'minus');
 575                $temp += self::_getFile($locale, '/ldml/numbers/symbols/exponential',     '', 'exponent');
 576                $temp += self::_getFile($locale, '/ldml/numbers/symbols/perMille',        '', 'mille');
 577                $temp += self::_getFile($locale, '/ldml/numbers/symbols/infinity',        '', 'infinity');
 578                $temp += self::_getFile($locale, '/ldml/numbers/symbols/nan',             '', 'nan');
 579                break;
 580
 581            case 'nametocurrency':
 582                $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
 583                foreach ($_temp as $key => $found) {
 584                    $temp += self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
 585                }
 586                break;
 587
 588            case 'currencytoname':
 589                $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
 590                foreach ($_temp as $key => $keyvalue) {
 591                    $val = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
 592                    if (!isset($val[$key])) {
 593                        continue;
 594                    }
 595                    if (!isset($temp[$val[$key]])) {
 596                        $temp[$val[$key]] = $key;
 597                    } else {
 598                        $temp[$val[$key]] .= " " . $key;
 599                    }
 600                }
 601                break;
 602
 603            case 'currencysymbol':
 604                $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
 605                foreach ($_temp as $key => $found) {
 606                    $temp += self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/symbol', '', $key);
 607                }
 608                break;
 609
 610            case 'question':
 611                $temp  = self::_getFile($locale, '/ldml/posix/messages/yesstr',  '', 'yes');
 612                $temp += self::_getFile($locale, '/ldml/posix/messages/nostr',   '', 'no');
 613                break;
 614
 615            case 'currencyfraction':
 616                $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info', 'iso4217');
 617                foreach ($_temp as $key => $found) {
 618                    $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $key . '\']', 'digits', $key);
 619                }
 620                break;
 621
 622            case 'currencyrounding':
 623                $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info', 'iso4217');
 624                foreach ($_temp as $key => $found) {
 625                    $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $key . '\']', 'rounding', $key);
 626                }
 627                break;
 628
 629            case 'currencytoregion':
 630                $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
 631                foreach ($_temp as $key => $keyvalue) {
 632                    $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
 633                }
 634                break;
 635
 636            case 'regiontocurrency':
 637                $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
 638                foreach ($_temp as $key => $keyvalue) {
 639                    $val = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
 640                    if (!isset($val[$key])) {
 641                        continue;
 642                    }
 643                    if (!isset($temp[$val[$key]])) {
 644                        $temp[$val[$key]] = $key;
 645                    } else {
 646                        $temp[$val[$key]] .= " " . $key;
 647                    }
 648                }
 649                break;
 650
 651            case 'regiontoterritory':
 652                $_temp = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
 653                foreach ($_temp as $key => $found) {
 654                    $temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
 655                }
 656                break;
 657
 658            case 'territorytoregion':
 659                $_temp2 = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
 660                $_temp = array();
 661                foreach ($_temp2 as $key => $found) {
 662                    $_temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
 663                }
 664                foreach($_temp as $key => $found) {
 665                    $_temp3 = explode(" ", $found);
 666                    foreach($_temp3 as $found3) {
 667                        if (!isset($temp[$found3])) {
 668                            $temp[$found3] = (string) $key;
 669                        } else {
 670                            $temp[$found3] .= " " . $key;
 671                        }
 672                    }
 673                }
 674                break;
 675
 676            case 'scripttolanguage':
 677                $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
 678                foreach ($_temp as $key => $found) {
 679                    $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
 680                    if (empty($temp[$key])) {
 681                        unset($temp[$key]);
 682                    }
 683                }
 684                break;
 685
 686            case 'languagetoscript':
 687                $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
 688                $_temp = array();
 689                foreach ($_temp2 as $key => $found) {
 690                    $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
 691                }
 692                foreach($_temp as $key => $found) {
 693                    $_temp3 = explode(" ", $found);
 694                    foreach($_temp3 as $found3) {
 695                        if (empty($found3)) {
 696                            continue;
 697                        }
 698                        if (!isset($temp[$found3])) {
 699                            $temp[$found3] = (string) $key;
 700                        } else {
 701                            $temp[$found3] .= " " . $key;
 702                        }
 703                    }
 704                }
 705                break;
 706
 707            case 'territorytolanguage':
 708                $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
 709                foreach ($_temp as $key => $found) {
 710                    $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
 711                    if (empty($temp[$key])) {
 712                        unset($temp[$key]);
 713                    }
 714                }
 715                break;
 716
 717            case 'languagetoterritory':
 718                $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
 719                $_temp = array();
 720                foreach ($_temp2 as $key => $found) {
 721                    $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
 722                }
 723                foreach($_temp as $key => $found) {
 724                    $_temp3 = explode(" ", $found);
 725                    foreach($_temp3 as $found3) {
 726                        if (empty($found3)) {
 727                            continue;
 728                        }
 729                        if (!isset($temp[$found3])) {
 730                            $temp[$found3] = (string) $key;
 731                        } else {
 732                            $temp[$found3] .= " " . $key;
 733                        }
 734                    }
 735                }
 736                break;
 737
 738            case 'timezonetowindows':
 739                $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone', 'other');
 740                foreach ($_temp as $key => $found) {
 741                    $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@other=\'' . $key . '\']', 'type', $key);
 742                }
 743                break;
 744
 745            case 'windowstotimezone':
 746                $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone', 'type');
 747                foreach ($_temp as $key => $found) {
 748                    $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@type=\'' .$key . '\']', 'other', $key);
 749                }
 750                break;
 751
 752            case 'territorytotimezone':
 753                $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem', 'type');
 754                foreach ($_temp as $key => $found) {
 755                    $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@type=\'' . $key . '\']', 'territory', $key);
 756                }
 757                break;
 758
 759            case 'timezonetoterritory':
 760                $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem', 'territory');
 761                foreach ($_temp as $key => $found) {
 762                    $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@territory=\'' . $key . '\']', 'type', $key);
 763                }
 764                break;
 765
 766            case 'citytotimezone':
 767                $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
 768                foreach($_temp as $key => $found) {
 769                    $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
 770                }
 771                break;
 772
 773            case 'timezonetocity':
 774                $_temp  = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
 775                $temp = array();
 776                foreach($_temp as $key => $found) {
 777                    $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
 778                    if (!empty($temp[$key])) {
 779                        $temp[$temp[$key]] = $key;
 780                    }
 781                    unset($temp[$key]);
 782                }
 783                break;
 784
 785            case 'phonetoterritory':
 786                $_temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
 787                foreach ($_temp as $key => $keyvalue) {
 788                    $temp += self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
 789                }
 790                break;
 791
 792            case 'territorytophone':
 793                $_temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
 794                foreach ($_temp as $key => $keyvalue) {
 795                    $val = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
 796                    if (!isset($val[$key])) {
 797                        continue;
 798                    }
 799                    if (!isset($temp[$val[$key]])) {
 800                        $temp[$val[$key]] = $key;
 801                    } else {
 802                        $temp[$val[$key]] .= " " . $key;
 803                    }
 804                }
 805                break;
 806
 807            case 'numerictoterritory':
 808                $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'type');
 809                foreach ($_temp as $key => $keyvalue) {
 810                    $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\'' . $key . '\']', 'numeric', $key);
 811                }
 812                break;
 813
 814            case 'territorytonumeric':
 815                $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'numeric');
 816                foreach ($_temp as $key => $keyvalue) {
 817                    $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@numeric=\'' . $key . '\']', 'type', $key);
 818                }
 819                break;
 820
 821            case 'alpha3toterritory':
 822                $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'type');
 823                foreach ($_temp as $key => $keyvalue) {
 824                    $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\'' . $key . '\']', 'alpha3', $key);
 825                }
 826                break;
 827
 828            case 'territorytoalpha3':
 829                $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'alpha3');
 830                foreach ($_temp as $key => $keyvalue) {
 831                    $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@alpha3=\'' . $key . '\']', 'type', $key);
 832                }
 833                break;
 834
 835            case 'postaltoterritory':
 836                $_temp = self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex', 'territoryId');
 837                foreach ($_temp as $key => $keyvalue) {
 838                    $temp += self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex[@territoryId=\'' . $key . '\']', 'territoryId');
 839                }
 840                break;
 841
 842            case 'numberingsystem':
 843                $_temp = self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem', 'id');
 844                foreach ($_temp as $key => $keyvalue) {
 845                    $temp += self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem[@id=\'' . $key . '\']', 'digits', $key);
 846                    if (empty($temp[$key])) {
 847                        unset($temp[$key]);
 848                    }
 849                }
 850                break;
 851
 852            case 'chartofallback':
 853                $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
 854                foreach ($_temp as $key => $keyvalue) {
 855                    $temp2 = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
 856                    $temp[current($temp2)] = $key;
 857                }
 858                break;
 859
 860            case 'fallbacktochar':
 861                $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
 862                foreach ($_temp as $key => $keyvalue) {
 863                    $temp += self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
 864                }
 865                break;
 866
 867            case 'localeupgrade':
 868                $_temp = self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag', 'from');
 869                foreach ($_temp as $key => $keyvalue) {
 870                    $temp += self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag[@from=\'' . $key . '\']', 'to', $key);
 871                }
 872                break;
 873
 874            case 'unit':
 875                $_temp = self::_getFile($locale, '/ldml/units/unit', 'type');
 876                foreach($_temp as $key => $keyvalue) {
 877                    $_temp2 = self::_getFile($locale, '/ldml/units/unit[@type=\'' . $key . '\']/unitPattern', 'count');
 878                    $temp[$key] = $_temp2;
 879                }
 880                break;
 881
 882            default :
 883                require_once 'Zend/Locale/Exception.php';
 884                throw new Zend_Locale_Exception("Unknown list ($path) for parsing locale data.");
 885                break;
 886        }
 887
 888        if (isset(self::$_cache)) {
 889            if (self::$_cacheTags) {
 890                self::$_cache->save( serialize($temp), $id, array('Zend_Locale'));
 891            } else {
 892                self::$_cache->save( serialize($temp), $id);
 893            }
 894        }
 895
 896        return $temp;
 897    }
 898
 899    /**
 900     * Read the LDML file, get a single path defined value
 901     *
 902     * @param  string $locale
 903     * @param  string $path
 904     * @param  string $value
 905     * @return string
 906     * @access public
 907     */
 908    public static function getContent($locale, $path, $value = false)
 909    {
 910        $locale = self::_checkLocale($locale);
 911
 912        if (!isset(self::$_cache) && !self::$_cacheDisabled) {
 913            require_once 'Zend/Cache.php';
 914            self::$_cache = Zend_Cache::factory(
 915                'Core',
 916                'File',
 917                array('automatic_serialization' => true),
 918                array());
 919        }
 920
 921        $val = $value;
 922        if (is_array($value)) {
 923            $val = implode('_' , $value);
 924        }
 925        $val = urlencode($val);
 926        $id = strtr('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val, array('-' => '_', '%' => '_', '+' => '_'));
 927        if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
 928            return unserialize($result);
 929        }
 930
 931        switch(strtolower($path)) {
 932            case 'language':
 933                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language[@type=\'' . $value . '\']', 'type');
 934                break;
 935
 936            case 'script':
 937                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script[@type=\'' . $value . '\']', 'type');
 938                break;
 939
 940            case 'country':
 941            case 'territory':
 942                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory[@type=\'' . $value . '\']', 'type');
 943                break;
 944
 945            case 'variant':
 946                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant[@type=\'' . $value . '\']', 'type');
 947                break;
 948
 949            case 'key':
 950                $temp = self::_getFile($locale, '/ldml/localeDisplayNames/keys/key[@type=\'' . $value . '\']', 'type');
 951                break;
 952
 953            case 'defaultcalendar':
 954                $temp = self::_getFile($locale, '/ldml/dates/calendars/default', 'choice', 'default');
 955                break;
 956
 957            case 'monthcontext':
 958                if (empty ($value)) {
 959                    $value = "gregorian";
 960                }
 961                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/default', 'choice', 'context');
 962                break;
 963
 964            case 'defaultmonth':
 965                if (empty ($value)) {
 966                    $value = "gregorian";
 967                }
 968                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/default', 'choice', 'default');
 969                break;
 970
 971            case 'month':
 972                if (!is_array($value)) {
 973                    $temp = $value;
 974                    $value = array("gregorian", "format", "wide", $temp);
 975                }
 976                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month[@type=\'' . $value[3] . '\']', 'type');
 977                break;
 978
 979            case 'daycontext':
 980                if (empty($value)) {
 981                    $value = "gregorian";
 982                }
 983                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/default', 'choice', 'context');
 984                break;
 985
 986            case 'defaultday':
 987                if (empty($value)) {
 988                    $value = "gregorian";
 989                }
 990                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/default', 'choice', 'default');
 991                break;
 992
 993            case 'day':
 994                if (!is_array($value)) {
 995                    $temp = $value;
 996                    $value = array("gregorian", "format", "wide", $temp);
 997                }
 998                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/days/dayContext[@type=\'' . $value[1] . '\']/dayWidth[@type=\'' . $value[2] . '\']/day[@type=\'' . $value[3] . '\']', 'type');
 999                break;
1000
1001            case 'quarter':
1002                if (!is_array($value)) {
1003                    $temp = $value;
1004                    $value = array("gregorian", "format", "wide", $temp);
1005                }
1006                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/quarters/quarterContext[@type=\'' . $value[1] . '\']/quarterWidth[@type=\'' . $value[2] . '\']/quarter[@type=\'' . $value[3] . '\']', 'type');
1007                break;
1008
1009            case 'am':
1010                if (empty($value)) {
1011                    $value = "gregorian";
1012                }
1013                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/am', '', 'am');
1014                break;
1015
1016            case 'pm':
1017                if (empty($value)) {
1018                    $value = "gregorian";
1019                }
1020                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/pm', '', 'pm');
1021                break;
1022
1023            case 'era':
1024                if (!is_array($value)) {
1025                    $temp = $value;
1026                    $value = array("gregorian", "Abbr", $temp);
1027                }
1028                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/eras/era' . $value[1] . '/era[@type=\'' . $value[2] . '\']', 'type');
1029                break;
1030
1031            case 'defaultdate':
1032                if (empty($value)) {
1033                    $value = "gregorian";
1034                }
1035                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/default', 'choice', 'default');
1036                break;
1037
1038            case 'date':
1039                if (empty($value)) {
1040                    $value = array("gregorian", "medium");
1041                }
1042                if (!is_array($value)) {
1043                    $temp = $value;
1044                    $value = array("gregorian", $temp);
1045                }
1046                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateFormats/dateFormatLength[@type=\'' . $value[1] . '\']/dateFormat/pattern', '', 'pattern');
1047                break;
1048
1049            case 'defaulttime':
1050                if (empty($value)) {
1051                    $value = "gregorian";
1052                }
1053                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/default', 'choice', 'default');
1054                break;
1055
1056            case 'time':
1057                if (empty($value)) {
1058                    $value = array("gregorian", "medium");
1059                }
1060                if (!is_array($value)) {
1061                    $temp = $value;
1062                    $value = array("gregorian", $temp);
1063                }
1064                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/timeFormats/timeFormatLength[@type=\'' . $value[1] . '\']/timeFormat/pattern', '', 'pattern');
1065                break;
1066
1067            case 'datetime':
1068                if (empty($value)) {
1069                    $value = array("gregorian", "medium");
1070                }
1071                if (!is_array($value)) {
1072                    $temp = $value;
1073                    $value = array("gregorian", $temp);
1074                }
1075
1076                $date     = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateFormats/dateFormatLength[@type=\'' . $value[1] . '\']/dateFormat/pattern', '', 'pattern');
1077                $time     = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/timeFormats/timeFormatLength[@type=\'' . $value[1] . '\']/timeFormat/pattern', '', 'pattern');
1078                $datetime = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'' . $value[1] . '\']/dateTimeFormat/pattern', '', 'pattern');
1079                $temp = str_replace(array('{0}', '{1}'), array(current($time), current($date)), current($datetime));
1080                break;
1081
1082            case 'dateitem':
1083                if (empty($value)) {
1084                    $value = array("gregorian", "yyMMdd");
1085                }
1086                if (!is_array($value)) {
1087                    $temp = $value;
1088                    $value = array("gregorian", $temp);
1089                }
1090                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/availableFormats/dateFormatItem[@id=\'' . $value[1] . '\']', '');
1091                break;
1092
1093            case 'dateinterval':
1094                if (empty($value)) {
1095                    $value = array("gregorian", "yMd", "y");
1096                }
1097                if (!is_array($value)) {
1098                    $temp = $value;
1099                    $value = array("gregorian", $temp, $temp[0]);
1100                }
1101                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/intervalFormats/intervalFormatItem[@id=\'' . $value[1] . '\']/greatestDifference[@id=\'' . $value[2] . '\']', '');
1102                break;
1103
1104            case 'field':
1105                if (!is_array($value)) {
1106                    $temp = $value;
1107                    $value = array("gregorian", $temp);
1108                }
1109                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/fields/field[@type=\'' . $value[1] . '\']/displayName', '', $value[1]);
1110                break;
1111
1112            case 'relative':
1113                if (!is_array($value)) {
1114                    $temp = $value;
1115                    $value = array("gregorian", $temp);
1116                }
1117                $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/fields/field/relative[@type=\'' . $value[1] . '\']', '', $value[1]);
1118                break;
1119
1120            case 'defaultnumberingsystem':
1121                $temp = self::_getFile($locale, '/ldml/numbers/defaultNumberingSystem', '', 'default');
1122                break;
1123
1124            case 'decimalnumber':
1125                $temp = self::_getFile($locale, '/ldml/numbers/decimalFormats/decimalFormatLength/decimalFormat/pattern', '', 'default');
1126                break;
1127
1128            case 'scientificnumber':
1129                $temp = self::_getFile($locale, '/ldml/numbers/scientificFormats/scientificFormatLength/scientificFormat/pattern', '', 'default');
1130                break;
1131
1132            case 'percentnumber':
1133                $temp = self::_getFile($locale, '/ldml/numbers/percentFormats/percentFormatLength/percentFormat/pattern', '', 'default');
1134                break;
1135
1136            case 'currencynumber':
1137                $temp = self::_getFile($locale, '/ldml/numbers/currencyFormats/currencyFormatLength/currencyFormat/pattern', '', 'default');
1138                break;
1139
1140            case 'nametocurrency':
1141                $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/displayName', '', $value);
1142                break;
1143
1144            case 'currencytoname':
1145                $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/displayName', '', $value);
1146                $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
1147                $temp = array();
1148                foreach ($_temp as $key => $keyvalue) {
1149                    $val = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
1150                    if (!isset($val[$key]) or ($val[$key] != $value)) {
1151                        continue;
1152                    }
1153                    if (!isset($temp[$val[$key]])) {
1154                        $temp[$val[$key]] = $key;
1155                    } else {
1156                        $temp[$val[$key]] .= " " . $key;
1157                    }
1158                }
1159                break;
1160
1161            case 'currencysymbol':
1162                $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/symbol', '', $value);
1163                break;
1164
1165            case 'question':
1166                $temp = self::_getFile($locale, '/ldml/posix/messages/' . $value . 'str',  '', $value);
1167                break;
1168
1169            case 'currencyfraction':
1170                if (empty($value)) {
1171                    $value = "DEFAULT";
1172                }
1173                $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $value . '\']', 'digits', 'digits');
1174                break;
1175
1176            case 'currencyrounding':
1177                if (empty($value)) {
1178                    $value = "DEFAULT";
1179                }
1180                $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $value . '\']', 'rounding', 'rounding');
1181                break;
1182
1183            case 'currencytoregion':
1184                $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $value . '\']/currency', 'iso4217', $value);
1185                break;
1186
1187            case 'regiontocurrency':
1188                $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
1189                $temp = array();
1190                foreach ($_temp as $key => $keyvalue) {
1191                    $val = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
1192                    if (!isset($val[$key]) or ($val[$key] != $value)) {
1193                        continue;
1194                    }
1195                    if (!isset($temp[$val[$key]])) {
1196                        $temp[$val[$key]] = $key;
1197                    } else {
1198                        $temp[$val[$key]] .= " " . $key;
1199                    }
1200                }
1201                break;
1202
1203            case 'regiontoterritory':
1204                $temp = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $value . '\']', 'contains', $value);
1205                break;
1206
1207            case 'territorytoregion':
1208                $_temp2 = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
1209                $_temp = array();
1210                foreach ($_temp2 as $key => $found) {
1211                    $_temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
1212                }
1213                $temp = array();
1214                foreach($_temp as $key => $found) {
1215                    $_temp3 = explode(" ", $found);
1216                    foreach($_temp3 as $found3) {
1217                        if ($found3 !== $value) {
1218                            continue;
1219                        }
1220                        if (!isset($temp[$found3])) {
1221                            $temp[$found3] = (string) $key;
1222                        } else {
1223                            $temp[$found3] .= " " . $key;
1224                        }
1225                    }
1226                }
1227                break;
1228
1229            case 'scripttolanguage':
1230                $temp = self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $value . '\']', 'scripts', $value);
1231                break;
1232
1233            case 'languagetoscript':
1234                $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
1235                $_temp = array();
1236                foreach ($_temp2 as $key => $found) {
1237                    $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
1238                }
1239                $temp = array();
1240                foreach($_temp as $key => $found) {
1241                    $_temp3 = explode(" ", $found);
1242                    foreach($_temp3 as $found3) {
1243                        if ($found3 !== $value) {
1244                            continue;
1245                        }
1246                        if (!isset($temp[$found3])) {
1247                            $temp[$found3] = (string) $key;
1248                        } else {
1249                            $temp[$found3] .= " " . $key;
1250                        }
1251                    }
1252                }
1253                break;
1254
1255            case 'territorytolanguage':
1256                $temp = self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $value . '\']', 'territories', $value);
1257                break;
1258
1259            case 'languagetoterritory':
1260                $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
1261                $_temp = array();
1262                foreach ($_temp2 as $key => $found) {
1263                    $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
1264                }
1265                $temp = array();
1266                foreach($_temp as $key => $found) {
1267                    $_temp3 = explode(" ", $found);
1268                    foreach($_temp3 as $found3) {
1269                        if ($found3 !== $value) {
1270                            continue;
1271                        }
1272                        if (!isset($temp[$found3])) {
1273                            $temp[$found3] = (string) $key;
1274                        } else {
1275                            $temp[$found3] .= " " . $key;
1276                        }
1277                    }
1278                }
1279                break;
1280
1281            case 'timezonetowindows':
1282                $temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@other=\''.$value.'\']', 'type', $value);
1283                break;
1284
1285            case 'windowstotimezone':
1286                $temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@type=\''.$value.'\']', 'other', $value);
1287                break;
1288
1289            case 'territorytotimezone':
1290                $temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@type=\'' . $value . '\']', 'territory', $value);
1291                break;
1292
1293            case 'timezonetoterritory':
1294                $temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@territory=\'' . $value . '\']', 'type', $value);
1295                break;
1296
1297            case 'citytotimezone':
1298                $temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $value . '\']/exemplarCity', '', $value);
1299                break;
1300
1301            case 'timezonetocity':
1302                $_temp  = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
1303                $temp = array();
1304                foreach($_temp as $key => $found) {
1305                    $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
1306                    if (!empty($temp[$key])) {
1307                        if ($temp[$key] == $value) {
1308                            $temp[$temp[$key]] = $key;
1309                        }
1310                    }
1311                    unset($temp[$key]);
1312                }
1313                break;
1314
1315            case 'phonetoterritory':
1316                $temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $value . '\']/telephoneCountryCode', 'code', $value);
1317                break;
1318
1319            case 'territorytophone':
1320                $_temp2 = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
1321                $_temp = array();
1322                foreach ($_temp2 as $key => $found) {
1323                    $_temp += self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
1324                }
1325                $temp = array();
1326                foreach($_temp as $key => $found) {
1327                    $_temp3 = explode(" ", $found);
1328                    foreach($_temp3 as $found3) {
1329                        if ($found3 !== $value) {
1330                            continue;
1331                        }
1332                        if (!isset($temp[$found3])) {
1333                            $temp[$found3] = (string) $key;
1334                        } else {
1335                            $temp[$found3] .= " " . $key;
1336                        }
1337                    }
1338                }
1339                break;
1340
1341            case 'numerictoterritory':
1342                $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\''.$value.'\']', 'numeric', $value);
1343                break;
1344
1345            case 'territorytonumeric':
1346                $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@numeric=\''.$value.'\']', 'type', $value);
1347                break;
1348
1349            case 'alpha3toterritory':
1350                $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\''.$value.'\']', 'alpha3', $value);
1351                break;
1352
1353            case 'territorytoalpha3':
1354                $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@alpha3=\''.$value.'\']', 'type', $value);
1355                break;
1356
1357            case 'postaltoterritory':
1358                $temp = self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex[@territoryId=\'' . $value . '\']', 'territoryId');
1359                break;
1360
1361            case 'numberingsystem':
1362                $temp = self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem[@id=\'' . strtolower($value) . '\']', 'digits', $value);
1363                break;
1364
1365            case 'chartofallback':
1366                $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
1367                foreach ($_temp as $key => $keyvalue) {
1368                    $temp2 = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
1369                    if (current($temp2) == $value) {
1370                        $temp = $key;
1371                    }
1372                }
1373                break;
1374
1375                $temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $value . '\']/substitute', '', $value);
1376                break;
1377
1378            case 'fallbacktochar':
1379                $temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $value . '\']/substitute', '');
1380                break;
1381
1382            case 'localeupgrade':
1383                $temp = self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag[@from=\'' . $value . '\']', 'to', $value);
1384                break;
1385
1386            case 'unit':
1387                $temp = self::_getFile($locale, '/ldml/units/unit[@type=\'' . $value[0] . '\']/unitPattern[@count=\'' . $value[1] . '\']', '');
1388                break;
1389
1390            default :
1391                require_once 'Zend/Locale/Exception.php';
1392                throw new Zend_Locale_Exception("Unknown detail ($path) for parsing locale data.");
1393                break;
1394        }
1395
1396        if (is_array($temp)) {
1397            $temp = current($temp);
1398        }
1399        if (isset(self::$_cache)) {
1400            if (self::$_cacheTags) {
1401                self::$_cache->save( serialize($temp), $id, array('Zend_Locale'));
1402            } else {
1403                self::$_cache->save( serialize($temp), $id);
1404            }
1405        }
1406
1407        return $temp;
1408    }
1409
1410    /**
1411     * Returns the set cache
1412     *
1413     * @return Zend_Cache_Core The set cache
1414     */
1415    public static function getCache()
1416    {
1417        return self::$_cache;
1418    }
1419
1420    /**
1421     * Set a cache for Zend_Locale_Data
1422     *
1423     * @param Zend_Cache_Core $cache A cache frontend
1424     */
1425    public static function setCache(Zend_Cache_Core $cache)
1426    {
1427        self::$_cache = $cache;
1428        self::_getTagSupportForCache();
1429    }
1430
1431    /**
1432     * Returns true when a cache is set
1433     *
1434     * @return boolean
1435     */
1436    public static function hasCache()
1437    {
1438        if (self::$_cache !== null) {
1439            return true;
1440        }
1441
1442        return false;
1443    }
1444
1445    /**
1446     * Removes any set cache
1447     *
1448     * @return void
1449     */
1450    public static function removeCache()
1451    {
1452        self::$_cache = null;
1453    }
1454
1455    /**
1456     * Clears all set cache data
1457     *
1458     * @return void
1459     */
1460    public static function clearCache()
1461    {
1462        if (self::$_cacheTags) {
1463            self::$_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('Zend_Locale'));
1464        } else {
1465            self::$_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
1466        }
1467    }
1468
1469    /**
1470     * Disables the cache
1471     *
1472     * @param unknown_type $flag
1473     */
1474    public static function disableCache($flag)
1475    {
1476        self::$_cacheDisabled = (boolean) $flag;
1477    }
1478
1479    /**
1480     * Internal method to check if the given cache supports tags
1481     *
1482     * @param Zend_Cache $cache
1483     */
1484    private static function _getTagSupportForCache()
1485    {
1486        $backend = self::$_cache->getBackend();
1487        if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
1488            $cacheOptions = $backend->getCapabilities();
1489            self::$_cacheTags = $cacheOptions['tags'];
1490        } else {
1491            self::$_cacheTags = false;
1492        }
1493
1494        return self::$_cacheTags;
1495    }
1496}