|
|
@@ -56,7 +56,6 @@ class Zend_Application_Resource_Locale
|
|
|
return $this->getLocale();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* Retrieve locale object
|
|
|
*
|
|
|
@@ -66,7 +65,8 @@ class Zend_Application_Resource_Locale
|
|
|
{
|
|
|
if (null === $this->_locale) {
|
|
|
$options = $this->getOptions();
|
|
|
- if(!isset($options['default'])) {
|
|
|
+
|
|
|
+ if (!isset($options['default'])) {
|
|
|
$this->_locale = new Zend_Locale();
|
|
|
} elseif(!isset($options['force']) ||
|
|
|
(bool) $options['force'] == false)
|
|
|
@@ -86,4 +86,32 @@ class Zend_Application_Resource_Locale
|
|
|
|
|
|
return $this->_locale;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the cache
|
|
|
+ *
|
|
|
+ * @param string|Zend_Cache_Core $cache
|
|
|
+ * @return Zend_Application_Resource_Locale
|
|
|
+ */
|
|
|
+ public function setCache($cache)
|
|
|
+ {
|
|
|
+ if (is_string($cache)) {
|
|
|
+ $bootstrap = $this->getBootstrap();
|
|
|
+ if ($bootstrap instanceof Zend_Application_Bootstrap_ResourceBootstrapper
|
|
|
+ && $bootstrap->hasPluginResource('CacheManager')
|
|
|
+ ) {
|
|
|
+ $cacheManager = $bootstrap->bootstrap('CacheManager')
|
|
|
+ ->getResource('CacheManager');
|
|
|
+ if (null !== $cacheManager && $cacheManager->hasCache($cache)) {
|
|
|
+ $cache = $cacheManager->getCache($cache);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($cache instanceof Zend_Cache_Core) {
|
|
|
+ Zend_Locale::setCache($cache);
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
}
|