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


PHP Zend_Translate::hasCache方法代码示例

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


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

示例1: cleartranslationcacheAction

 /**
  * Clears the translation cache
  *
  * @return void
  */
 public function cleartranslationcacheAction()
 {
     if (Zend_Translate::hasCache()) {
         Zend_Translate::clearCache();
     }
     $this->_redirect($_SERVER['HTTP_REFERER'], array('code' => 302));
 }
开发者ID:dmj,项目名称:uni-helmstedt.hab.de,代码行数:12,代码来源:DebugController.php

示例2: updateTransAction

 public function updateTransAction()
 {
     foreach ($this->getRequest()->getParam('trans') as $lang => $trans) {
         $toReplace = array();
         $toReplace[$this->getRequest()->getParam('text')] = $trans;
         $this->getDi()->translationTable->replaceTranslation($toReplace, $lang);
     }
     Zend_Translate::hasCache() && Zend_Translate::clearCache();
 }
开发者ID:grlf,项目名称:eyedock,代码行数:9,代码来源:AdminTransLocalController.php

示例3: testSetCacheThroughOptions

 /**
  * ZF-9877
  */
 public function testSetCacheThroughOptions()
 {
     require_once 'Zend/Cache.php';
     $cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 120, 'automatic_serialization' => true), array('cache_dir' => dirname(__FILE__) . '/_files/'));
     $translate = new Zend_Translate(array('adapter' => Zend_Translate::AN_ARRAY, 'content' => array('msg1' => 'Message 1 (en)'), 'locale' => 'en', 'cache' => $cache));
     $return = Zend_Translate::getCache();
     $this->assertTrue($return instanceof Zend_Cache_Core);
     $this->assertTrue(Zend_Translate::hasCache());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:12,代码来源:TranslateTest.php

示例4: 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:netandreus,项目名称:zf,代码行数:18,代码来源:TranslateTest.php

示例5: saveAction

 function saveAction()
 {
     $trans = $this->getRequest()->getParam('trans', array());
     $translationData = $this->grid->getDataSource()->getTDataSource()->getTranslationData($this->getLanguage(), TranslationDataSource_Abstract::FETCH_MODE_ALL);
     $toReplace = array();
     foreach ($trans as $k => $v) {
         $k = base64_decode($k);
         if ($v != $translationData[$k]) {
             $toReplace[$k] = $v;
         }
     }
     if (count($toReplace)) {
         $this->getDi()->translationTable->replaceTranslation($toReplace, $this->language);
         if (Zend_Translate::hasCache()) {
             Zend_Translate::clearCache();
         }
     }
     $_POST['trans'] = $_GET['trans'] = null;
     $this->grid->getRequest()->setParam('trans', null);
     $this->grid->getCompleteRequest()->setParam('trans', null);
     $this->getRequest()->setParam('trans', null);
     $url = $this->makeUrl(null, 'index', null, $this->getRequest()->toArray());
     $this->isAjax() ? $this->redirectAjax($url, ___('Redirect')) : $this->redirectLocation($url);
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:24,代码来源:AdminTransGlobalController.php


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