当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Translate::removeCache方法代码示例

本文整理汇总了PHP中Zend_Translate::removeCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Translate::removeCache方法的具体用法?PHP Zend_Translate::removeCache怎么用?PHP Zend_Translate::removeCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Translate的用法示例。


在下文中一共展示了Zend_Translate::removeCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _setCache

 /**
  * Sets the translation cache
  *
  * @return void
  */
 protected function _setCache()
 {
     $options = $this->getOptions();
     // Disable cache? If not defined, cache will be active
     if (isset($options['cache']['active']) && !$options['cache']['active']) {
         // Explicitly remove cache, in case it was set before
         Zend_Translate::removeCache();
         return;
     }
     // Get the cache using the config settings as input
     $this->_bootstrap->bootstrap('CacheManager');
     $manager = $this->_bootstrap->getResource('CacheManager');
     $cache = $manager->getCache('translate');
     // Write caching errors to log file (if activated in the config)
     $this->_bootstrap->bootstrap('Log');
     $logger = $this->_bootstrap->getResource('Log');
     $cache->setOption('logger', $logger);
     Zend_Translate::setCache($cache);
 }
开发者ID:nstapelbroek,项目名称:Glitch_Lib,代码行数:24,代码来源:Translate.php

示例2: testTestingCacheHandling

 public function testTestingCacheHandling()
 {
     require_once 'Zend/Cache.php';
     $cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 120, 'automatic_serialization' => true), array('cache_dir' => dirname(__FILE__) . '/_files/'));
     Zend_Translate::setCache($cache);
     $cache = Zend_Translate::getCache();
     $this->assertTrue($cache instanceof Zend_Cache_Core);
     $this->assertTrue(Zend_Translate::hasCache());
     $lang = new Zend_Translate(Zend_Translate::AN_ARRAY, array('msg1' => 'Message 1 (en)'), 'en');
     $adapter = $lang->getAdapter();
     $this->assertTrue($adapter instanceof Zend_Translate_Adapter_Array);
     $adaptercache = $adapter->getCache();
     $this->assertTrue($adaptercache instanceof Zend_Cache_Core);
     Zend_Translate::clearCache();
     $this->assertTrue(Zend_Translate::hasCache());
     Zend_Translate::removeCache();
     $this->assertFalse(Zend_Translate::hasCache());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:18,代码来源:TranslateTest.php

示例3: testSetCacheFromCacheManager

 /**
  * @group ZF-10034
  */
 public function testSetCacheFromCacheManager()
 {
     $configCache = array('translate' => array('frontend' => array('name' => 'Core', 'options' => array('lifetime' => 120, 'automatic_serialization' => true)), 'backend' => array('name' => 'Black Hole')));
     $this->bootstrap->registerPluginResource('cachemanager', $configCache);
     $options = $this->_translationOptions;
     $options['cache'] = 'translate';
     $resource = new Zend_Application_Resource_Translate($options);
     $resource->setBootstrap($this->bootstrap);
     $resource->init();
     $this->assertTrue(Zend_Translate::getCache() instanceof Zend_Cache_Core);
     Zend_Translate::removeCache();
 }
开发者ID:jsnshrmn,项目名称:Suma,代码行数:15,代码来源:TranslateTest.php


注:本文中的Zend_Translate::removeCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。