當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Locale_Data::disableCache方法代碼示例

本文整理匯總了PHP中Zend_Locale_Data::disableCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Locale_Data::disableCache方法的具體用法?PHP Zend_Locale_Data::disableCache怎麽用?PHP Zend_Locale_Data::disableCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Locale_Data的用法示例。


在下文中一共展示了Zend_Locale_Data::disableCache方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _checkOptions

 /**
  * Internal function for checking the options array of proper input values
  * See {@link setOptions()} for details.
  *
  * @param  array  $options  Array of options, keyed by option name: format_type = 'iso' | 'php', fix_date = true | false,
  *                          locale = Zend_Locale | locale string, precision = whole number between -1 and 30
  * @throws Zend_Locale_Exception
  * @return Options array if no option was given
  */
 private static function _checkOptions(array $options = array())
 {
     if (count($options) == 0) {
         return self::$_options;
     }
     foreach ($options as $name => $value) {
         $name = strtolower($name);
         if ($name !== 'locale') {
             if (gettype($value) === 'string') {
                 $value = strtolower($value);
             }
         }
         switch ($name) {
             case 'number_format':
                 if ($value == Zend_Locale_Format::STANDARD) {
                     $locale = self::$_options['locale'];
                     if (isset($options['locale'])) {
                         $locale = $options['locale'];
                     }
                     $options['number_format'] = Zend_Locale_Data::getContent($locale, 'decimalnumber');
                 } else {
                     if (gettype($value) !== 'string' and $value !== NULL) {
                         // require_once 'Zend/Locale/Exception.php';
                         throw new Zend_Locale_Exception("Unknown number format type '" . gettype($value) . "'. " . "Format '{$value}' must be a valid number format string.");
                     }
                 }
                 break;
             case 'date_format':
                 if ($value == Zend_Locale_Format::STANDARD) {
                     $locale = self::$_options['locale'];
                     if (isset($options['locale'])) {
                         $locale = $options['locale'];
                     }
                     $options['date_format'] = Zend_Locale_Format::getDateFormat($locale);
                 } else {
                     if (gettype($value) !== 'string' and $value !== NULL) {
                         // require_once 'Zend/Locale/Exception.php';
                         throw new Zend_Locale_Exception("Unknown dateformat type '" . gettype($value) . "'. " . "Format '{$value}' must be a valid ISO or PHP date format string.");
                     } else {
                         if (isset($options['format_type']) === true and $options['format_type'] == 'php' or isset($options['format_type']) === false and self::$_options['format_type'] == 'php') {
                             $options['date_format'] = Zend_Locale_Format::convertPhpToIsoFormat($value);
                         }
                     }
                 }
                 break;
             case 'format_type':
                 if ($value != 'php' && $value != 'iso') {
                     // require_once 'Zend/Locale/Exception.php';
                     throw new Zend_Locale_Exception("Unknown date format type '{$value}'. Only 'iso' and 'php'" . " are supported.");
                 }
                 break;
             case 'fix_date':
                 if ($value !== true && $value !== false) {
                     // require_once 'Zend/Locale/Exception.php';
                     throw new Zend_Locale_Exception("Enabling correction of dates must be either true or false" . "(fix_date='{$value}').");
                 }
                 break;
             case 'locale':
                 $options['locale'] = Zend_Locale::findLocale($value);
                 break;
             case 'cache':
                 if ($value instanceof Zend_Cache_Core) {
                     Zend_Locale_Data::setCache($value);
                 }
                 break;
             case 'disablecache':
                 Zend_Locale_Data::disableCache($value);
                 break;
             case 'precision':
                 if ($value === NULL) {
                     $value = -1;
                 }
                 if ($value < -1 || $value > 30) {
                     // require_once 'Zend/Locale/Exception.php';
                     throw new Zend_Locale_Exception("'{$value}' precision is not a whole number less than 30.");
                 }
                 break;
             default:
                 // require_once 'Zend/Locale/Exception.php';
                 throw new Zend_Locale_Exception("Unknown option: '{$name}' = '{$value}'");
                 break;
         }
     }
     return $options;
 }
開發者ID:JaroslavRamba,項目名稱:ex-facebook-bundle,代碼行數:94,代碼來源:Format.php

示例2: disableCache

 /**
  * Disables the set cache
  *
  * @param  boolean $flag True disables any set cache, default is false
  * @return void
  */
 public static function disableCache($flag)
 {
     Zend_Locale_Data::disableCache($flag);
 }
開發者ID:kobmaki,項目名稱:icingaweb2,代碼行數:10,代碼來源:Locale.php

示例3: disableCache

 /**
  * Disables the set cache
  *
  * @param  boolean $flag True disables any set cache, default is false
  * @return void
  */
 public static function disableCache($flag)
 {
     require_once 'Zend/Locale/Data.php';
     Zend_Locale_Data::disableCache($flag);
 }
開發者ID:bizanto,項目名稱:Hooked,代碼行數:11,代碼來源:Locale.php


注:本文中的Zend_Locale_Data::disableCache方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。