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


PHP Zend_Cache_Core::remove方法代码示例

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


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

示例1: testRemove

 public function testRemove()
 {
     $this->rediska->set('test', array('aaa', time(), null));
     $this->cache->remove('test');
     $reply = $this->rediska->get('test');
     $this->assertNull($reply);
 }
开发者ID:utachkin,项目名称:Rediska,代码行数:7,代码来源:Cache.php

示例2: _deleteCache

 /**
  * Empty this cache instance
  */
 private function _deleteCache()
 {
     if ($this->_cache instanceof \Zend_Cache_Core) {
         $this->_cache->remove($this->_cacheid);
         $this->_cache->remove($this->_cacheid . 'trans');
     }
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:10,代码来源:Roles.php

示例3: testRemove

 /**
  *
  * @group cache_remove
  */
 public function testRemove()
 {
     $this->cache->save('', 'test_data');
     $reply = $this->cache->load('test_data');
     $this->assertFalse($reply);
     $this->cache->save('aaa', 'test_data');
     $reply = $this->cache->load('test_data');
     $this->assertEquals('aaa', $reply);
     $this->cache->remove('test_data');
     $reply = $this->cache->load('test_data');
     $this->assertFalse($reply);
 }
开发者ID:r-kovalenko,项目名称:Rediska,代码行数:16,代码来源:CacheTest.php

示例4: removeByPartialId

 /**
  * @param $id
  * @return bool|int
  */
 public function removeByPartialId($id)
 {
     if (is_object($this->_cache)) {
         $counter = 0;
         $cacheIds = $this->_cache->getIds();
         foreach ($cacheIds as $cid) {
             if (strpos($cid, $id) !== false) {
                 $this->_cache->remove($cid);
                 $counter++;
             }
         }
         return $counter;
     }
     return false;
 }
开发者ID:akawalko,项目名称:zfext,代码行数:19,代码来源:Table.php

示例5: removeAclsCache

 /**
  * 清除权限关系缓存
  *
  * @return boolean
  */
 public function removeAclsCache()
 {
     if (null !== self::$_cache) {
         return self::$_cache->remove('acl');
     }
     return true;
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:12,代码来源:Loader.php

示例6: _prepareAcl

 /**
  * @return controlar
  */
 private function _prepareAcl()
 {
     if (!is_null($this->usuario) && !is_null($this->usuario->ID_UNIDADE)) {
         // atualizar informações da unidade do usuário na sessão
         // com as informações do banco, a menos que o usuário tenha trocado
         // Testar a existência de um cache de acl para o usuário
         if (!$this->cache->test('acl_' . $this->usuario->ID)) {
             $this->acl = AclFactory::createAcl($this->usuario);
             $this->cache->save($this->acl, 'acl_' . $this->usuario->ID, array('acl_usuario_' . $this->usuario->ID, 'acl_unidade_' . $this->usuario->ID_UNIDADE));
         } else {
             $this->acl = $this->cache->load('acl_' . $this->usuario->ID);
             if ($this->usuario->ID_UNIDADE != $this->acl->getIdUnidade()) {
                 if (!$this->acl->isTrocouUnidade() && !$this->usuario->TROCOU) {
                     // id do cache e da session não batem, e usuário não trocou de unidade
                     // limpar o cache e recriá-lo
                     $this->cache->remove('acl_' . $this->usuario->ID);
                     $this->cache->clean('matchingAnyTag', array('acl_usuario_' . $this->usuario->ID));
                     $this->acl = AclFactory::createAcl($this->usuario);
                     $this->cache->save($this->acl, 'acl_' . $this->usuario->ID, array('acl_usuario_' . $this->usuario->ID, 'acl_unidade_' . $this->usuario->ID_UNIDADE));
                     // limpar
                 }
             }
             $this->usuario = $this->acl->updateSession();
         }
         // Forçar permissão de troca de unidades pro usuário que já trocou de unidade
         if ($this->acl->isTrocouUnidade()) {
             $this->acl->allow($this->usuario->ID, 115);
         }
     }
     return $this;
 }
开发者ID:roquebrasilia,项目名称:sgdoc-codigo,代码行数:34,代码来源:Controlador.php

示例7: remove

 /**
  * Remove cached data by identifier
  *
  * @param string $id
  * @return bool
  */
 public function remove($id)
 {
     Magento_Profiler::start('cache_remove', $this->_generateProfilerTags('remove'));
     $result = $this->_frontend->remove($this->_id($id));
     Magento_Profiler::stop('cache_remove');
     return $result;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:13,代码来源:Cache.php

示例8: deleteSessionFromSource

 /**
  * Deletes the specified session from the source.
  *
  * @param string $sessionId
  */
 public function deleteSessionFromSource($sessionId)
 {
     if ($this->_cache) {
         $this->_cache->remove($this->_getSessionCacheName());
     } else {
         $this->_db->delete($this->_config['table'], 'session_id = ' . $this->_db->quote($sessionId));
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:13,代码来源:Session.php

示例9: invalidateCache

 /**
  * Empty the cache of the organization
  *
  * @return \Gems_User_Organization (continutation pattern)
  */
 public function invalidateCache()
 {
     if ($this->cache) {
         $cacheId = $this->_getCacheId();
         $this->cache->remove($cacheId);
     }
     return $this;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:13,代码来源:CachedArrayTargetAbstract.php

示例10: __destruct

 /**
  * Save the cache here
  */
 public function __destruct()
 {
     // \MUtil_Echo::track(count($this->_commands));
     if ($this->_commands) {
         $this->_cache->save($this->_commands, $this->_cacheId, array('batch', 'sess_' . session_id()));
     } else {
         $this->_cache->remove($this->_cacheId);
     }
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:12,代码来源:CacheStack.php

示例11: remove

 /**
  * Removes a key from the store
  *
  * @param string $key
  * @return boolean
  */
 public function remove($key)
 {
     if (null !== $this->cacheAdapter) {
         $this->logMessage('Removed key ' . $key);
         $prefixedKey = $this->prefixKey($key);
         return $this->cacheAdapter->remove($prefixedKey);
     }
     return false;
 }
开发者ID:cipherpols,项目名称:cze,代码行数:15,代码来源:CacheManager.php

示例12: getInstance

 /**
  * Récupère l'instance du singleton en gèrant la persistance
  * 
  * @param bool $clearCache détruit le cache auparavant
  * @return Cache_Acl
  */
 public static function getInstance($clearCache = false)
 {
     if (static::$_cache) {
         if ($clearCache) {
             static::$_cache->remove(self::CACHE_KEY);
         }
         if (false === (static::$_instance = static::$_cache->load(self::CACHE_KEY))) {
             if (static::$_instance == null) {
                 static::$_instance = new static();
             }
             static::$_cache->save(static::$_instance, self::CACHE_KEY);
         }
     } else {
         if (static::$_instance == null) {
             static::$_instance = new static();
         }
     }
     return static::$_instance;
 }
开发者ID:nikoul,项目名称:Projet-PHP-WebRadio,代码行数:25,代码来源:CacheAcl.php

示例13: clean

 /**
  * Remove cache matching id, prefix or tags
  * @param string $cacheId cache id to remove
  * @param string $cachePrefix cache prefix to remove
  * @param array $tags array of cache tags to remove
  */
 public function clean($cacheId = '', $cachePrefix = '', $tags = array())
 {
     $tags = $this->_sanitizeTags($tags);
     $this->_cache->clean(Zend_Cache::CLEANING_MODE_OLD);
     if (!$cachePrefix && !$cacheId) {
         if (is_array($tags) && !empty($tags)) {
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tags);
         } else {
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
         }
     } else {
         $cacheId = $this->_makeCacheId($cacheId, $cachePrefix);
         $this->_cache->remove($cacheId);
     }
 }
开发者ID:PavloKovalov,项目名称:seotoaster,代码行数:21,代码来源:Cache.php

示例14: clearPageItemCache

 /**
  * Clear the page item cache.
  *
  * @param int $pageNumber
  * @return Zend_Paginator
  */
 public function clearPageItemCache($pageNumber = null)
 {
     if (!$this->_cacheEnabled()) {
         return $this;
     }
     if (null === $pageNumber) {
         foreach (self::$_cache->getIdsMatchingTags(array($this->_getCacheInternalId())) as $id) {
             if (preg_match('|' . self::CACHE_TAG_PREFIX . "(\\d+)_.*|", $id, $page)) {
                 self::$_cache->remove($this->_getCacheId($page[1]));
             }
         }
     } else {
         $cleanId = $this->_getCacheId($pageNumber);
         self::$_cache->remove($cleanId);
     }
     return $this;
 }
开发者ID:netvlies,项目名称:zf,代码行数:23,代码来源:Paginator.php

示例15: setSetting

 public function setSetting($key, $value)
 {
     $key = $this->_normalizeMagicProperty($key);
     // Array mode
     if (is_array($value)) {
         foreach ($value as $k => $v) {
             $this->setSetting($key . '.' . $k, $v);
         }
     } else {
         $path = explode('.', $key);
         $final = array_pop($path);
         $current =& $this->_settings;
         if (!empty($path)) {
             foreach ($path as $pathElement) {
                 if (!isset($current[$pathElement]) || !is_array($current[$pathElement])) {
                     $current[$pathElement] = array();
                 }
                 $current =& $current[$pathElement];
             }
         }
         // Delete
         if (isset($current[$final]) && null === $value) {
             $this->delete(array('name = ?' => $key));
             $this->delete(array('name LIKE ?' => $key . '.%'));
             unset($current[$final]);
         } else {
             if (isset($current[$final])) {
                 // Only if not the same?
                 if ($current[$final] !== $value) {
                     $this->update(array('value' => $value), array('name = ?' => $key));
                 }
                 // Reselect?
                 $current[$final] = $this->find($key)->current()->value;
             } else {
                 $this->insert(array('name' => $key, 'value' => $value));
                 // Reselect?
                 $current[$final] = $this->find($key)->current()->value;
             }
         }
         // Flush the cache
         $this->_cache->remove('settings');
     }
     return $this;
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:44,代码来源:Settings.php


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