コード例 #1
1
ファイル: WinCache.php プロジェクト: blanc0/cecilia
 public function remove($key)
 {
     if ($key == 'all') {
         return wincache_ucache_clear() ? true : false;
     } else {
         if (wincache_ucache_exists($this->type . '_' . $key)) {
             return wincache_ucache_delete($this->type . '_' . $key) ? true : false;
         }
         return false;
     }
     return false;
 }
コード例 #2
0
ファイル: wincache.php プロジェクト: aberrios/WEBTHESGO
function cs_cache_delete($name, $ttl = 0)
{
    $token = empty($ttl) ? $name : 'ttl_' . $name;
    if (wincache_ucache_exists($token)) {
        wincache_ucache_delete($token);
    }
}
コード例 #3
0
ファイル: wincache.class.php プロジェクト: google2013/myqee
 /**
  * 删除指定key的缓存,若$key===true则表示删除全部
  *
  * @param string $key
  */
 public function delete($key)
 {
     if ($key === true) {
         return $this->delete_all();
     }
     return \wincache_ucache_delete($key);
 }
コード例 #4
0
 public function delete($key, $options= array()) {
     $deleted = false;
     if (!isset($options['multiple_object_delete']) || empty($options['multiple_object_delete'])) {
         $deleted= wincache_ucache_delete($this->getCacheKey($key));
     }
     return $deleted;
 }
コード例 #5
0
 public function delete($key)
 {
     if (function_exists('wincache_ucache_delete')) {
         return wincache_ucache_delete($key);
     } else {
         return getMessage('Cache', 'unsupported', 'Wincache');
     }
 }
コード例 #6
0
 public function remove($key)
 {
     try {
         return wincache_ucache_delete($key);
     } catch (Exception $ex) {
         throw new Exception($ex->getMessage(), $ex->getCode());
     }
 }
コード例 #7
0
 /**
  * (Plug-in replacement for memcache API) Delete data from the persistant cache.
  *
  * @param  mixed			Key name
  */
 function delete($key)
 {
     // Update list of e-objects
     global $ECACHE_OBJECTS;
     unset($ECACHE_OBJECTS[$key]);
     wincache_ucache_set(get_file_base() . 'ECACHE_OBJECTS', $ECACHE_OBJECTS, 0);
     wincache_ucache_delete($key);
 }
コード例 #8
0
ファイル: Wincache.php プロジェクト: jinshana/tangocms
 /**
  * Deletes an item out of the cache, or multiple items
  *
  * @param string|array $key
  * @return int
  */
 public function delete($key)
 {
     $delCount = 0;
     foreach (array_filter((array) $key) as $cacheKey) {
         if (wincache_ucache_delete($cacheKey)) {
             ++$delCount;
         }
     }
     return $delCount;
 }
コード例 #9
0
ファイル: wincache.php プロジェクト: vanie3/appland
 public function clean($group, $mode = null)
 {
     $allinfo = wincache_ucache_info();
     $keys = $allinfo['cache_entries'];
     $secret = $this->_hash;
     foreach ($keys as $key) {
         if (strpos($key['key_name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') {
             wincache_ucache_delete($key['key_name']);
         }
     }
     return true;
 }
コード例 #10
0
 /**
  * Delete all keys from the cache
  *
  * @param bool $check if true will check expiration, otherwise delete all
  * @return bool True if the cache was successfully cleared, false otherwise
  */
 public function clear($check)
 {
     if ($check) {
         return true;
     }
     $info = wincache_ucache_info();
     $cacheKeys = $info['ucache_entries'];
     unset($info);
     foreach ($cacheKeys as $key) {
         wincache_ucache_delete($key['key_name']);
     }
     return true;
 }
コード例 #11
0
ファイル: WinCacheDriver.php プロジェクト: kuria/cache
 public function filter($prefix)
 {
     $prefixLen = strlen($prefix);
     $info = wincache_ucache_info();
     $keysToDelete = array();
     foreach ($info['ucache_entries'] as $entry) {
         if (empty($entry['is_session']) && 0 === strncmp($entry['key_name'], $prefix, $prefixLen)) {
             $keysToDelete[] = $entry['key_name'];
         }
     }
     if ($keysToDelete) {
         wincache_ucache_delete($keysToDelete);
     }
     return true;
 }
コード例 #12
0
 /**
  * {@inheritdoc}
  */
 function loadClass($class)
 {
     // Look if the cache has anything for this class.
     if ($file = wincache_ucache_get($this->prefix . $class)) {
         if (is_file($file)) {
             require $file;
             return;
         }
         wincache_ucache_delete($this->prefix . $class);
     }
     // Resolve cache miss.
     $api = new LoadClassGetFileInjectedApi($class);
     if ($this->finder->apiFindFile($api, $class)) {
         wincache_ucache_set($this->prefix . $class, $api->getFile());
     }
 }
コード例 #13
0
ファイル: WincacheCache.php プロジェクト: Nyholm/acache
 /**
  * {@inheritDoc}
  */
 public function flush($namespace = null)
 {
     if (!$namespace) {
         return wincache_ucache_clear();
     } else {
         $namespace = implode($this->getNamespaceDelimiter(), (array) $namespace);
         $info = wincache_ucache_info(false);
         // iterate over all entries and delete matching
         foreach ($info['ucache_entries'] as $entry) {
             $key = $entry['key_name'];
             if (0 === strpos($key, $namespace)) {
                 wincache_ucache_delete($key);
             }
         }
     }
     return true;
 }
コード例 #14
0
ファイル: Wincache.class.php プロジェクト: novnan/meiju
 /**
  * 删除缓存
  * @access public
  * @param string $name 缓存变量名
  * @return boolean
  */
 public function rm($name)
 {
     return wincache_ucache_delete($this->options['prefix'] . $name);
 }
コード例 #15
0
ファイル: base.php プロジェクト: Mumcio/bookmark-manager
 /**
  *	Delete cache entry
  *	@return bool
  *	@param $key string
  **/
 function clear($key)
 {
     if (!$this->dsn) {
         return;
     }
     $ndx = $this->prefix . '.' . $key;
     $parts = explode('=', $this->dsn, 2);
     switch ($parts[0]) {
         case 'apc':
             return apc_delete($ndx);
         case 'memcache':
             return memcache_delete($this->ref, $ndx);
         case 'wincache':
             return wincache_ucache_delete($ndx);
         case 'xcache':
             return xcache_unset($ndx);
         case 'folder':
             return is_file($file = $parts[1] . $ndx) && @unlink($file);
     }
     return FALSE;
 }
コード例 #16
0
ファイル: base.php プロジェクト: Podbe/Podbe_V4-firtz-node
 /**
  *	Clear contents of cache backend
  *	@return bool
  *	@param $suffix string
  *	@param $lifetime int
  **/
 function reset($suffix = NULL, $lifetime = 0)
 {
     if (!$this->dsn) {
         return TRUE;
     }
     $regex = '/' . preg_quote($this->prefix . '.', '/') . '.+?' . preg_quote($suffix, '/') . '/';
     $parts = explode('=', $this->dsn, 2);
     switch ($parts[0]) {
         case 'apc':
             $key = 'info';
         case 'apcu':
             if (empty($key)) {
                 $key = 'key';
             }
             $info = apc_cache_info('users');
             foreach ($info['cache_list'] as $item) {
                 if (preg_match($regex, $item[$key]) && $item['mtime'] + $lifetime < time()) {
                     apc_delete($item[$key]);
                 }
             }
             return TRUE;
         case 'redis':
             $fw = Base::instance();
             $keys = $this->ref->keys($this->prefix . '.*' . $suffix);
             foreach ($keys as $key) {
                 $val = $fw->unserialize($this->ref->get($key));
                 if ($val[1] + $lifetime < time()) {
                     $this->ref->del($key);
                 }
             }
             return TRUE;
         case 'memcache':
             foreach (memcache_get_extended_stats($this->ref, 'slabs') as $slabs) {
                 foreach (array_filter(array_keys($slabs), 'is_numeric') as $id) {
                     foreach (memcache_get_extended_stats($this->ref, 'cachedump', $id) as $data) {
                         if (is_array($data)) {
                             foreach ($data as $key => $val) {
                                 if (preg_match($regex, $key) && $val[1] + $lifetime < time()) {
                                     memcache_delete($this->ref, $key);
                                 }
                             }
                         }
                     }
                 }
             }
             return TRUE;
         case 'wincache':
             $info = wincache_ucache_info();
             foreach ($info['ucache_entries'] as $item) {
                 if (preg_match($regex, $item['key_name']) && $item['use_time'] + $lifetime < time()) {
                     wincache_ucache_delete($item['key_name']);
                 }
             }
             return TRUE;
         case 'xcache':
             return TRUE;
             /* Not supported */
         /* Not supported */
         case 'folder':
             if ($glob = @glob($parts[1] . '*')) {
                 foreach ($glob as $file) {
                     if (preg_match($regex, basename($file)) && filemtime($file) + $lifetime < time()) {
                         @unlink($file);
                     }
                 }
             }
             return TRUE;
     }
     return FALSE;
 }
コード例 #17
0
ファイル: WincacheEngine.php プロジェクト: CakeDC/cakephp
 /**
  * Delete all keys from the cache. This will clear every
  * item in the cache matching the cache config prefix.
  *
  * @param bool $check If true, nothing will be cleared, as entries will
  *   naturally expire in wincache..
  * @return bool True Returns true.
  */
 public function clear($check)
 {
     if ($check) {
         return true;
     }
     $info = wincache_ucache_info();
     $cacheKeys = $info['ucache_entries'];
     unset($info);
     foreach ($cacheKeys as $key) {
         if (strpos($key['key_name'], $this->_config['prefix']) === 0) {
             wincache_ucache_delete($key['key_name']);
         }
     }
     return true;
 }
コード例 #18
0
 /**
  * Remove a value from the WinCache object cache
  *
  * @param $key String: cache key
  * @param $time Int: not used in this implementation
  * @return bool
  */
 public function delete($key, $time = 0)
 {
     wincache_ucache_delete($key);
     return true;
 }
コード例 #19
0
ファイル: Wincache.php プロジェクト: ambient-lounge/site
 /**
  * Destroy this cell collection
  */
 public function __destruct()
 {
     $cacheList = $this->getCellList();
     foreach ($cacheList as $cellID) {
         wincache_ucache_delete($this->cachePrefix . $cellID . '.cache');
     }
 }
コード例 #20
0
ファイル: Wincache.php プロジェクト: easinewe/Avec2016
 /**
  * Key to delete, deletes .old and primary if exists.
  * @param $key
  * @return bool
  */
 function hard_delete($key)
 {
     $key = $this->get_item_key($key);
     return wincache_ucache_delete($key . '_' . $this->_blog_id);
 }
コード例 #21
0
 /**
  * Delete from Cache
  *
  * @param	mixed	unique identifier of the item in the cache
  * @return	bool	true on success/false on failure
  */
 public function delete($id)
 {
     return wincache_ucache_delete($id);
 }
コード例 #22
0
 /**
 +----------------------------------------------------------
 * 删除缓存
 +----------------------------------------------------------
 * @access public
 +----------------------------------------------------------
 * @param string $name 缓存变量名
 +----------------------------------------------------------
 * @return boolen
 +----------------------------------------------------------
 */
 public function rm($name)
 {
     return wincache_ucache_delete($name);
 }
コード例 #23
0
 /**
  * Delete a cache entry via three possible methods...
  *   + Pass a Regular Expression (PCRE) string.
  *      + Requirement: $this->reg_exp_delimiter must be the delimiter.
  *   + Pass a search string with *unix based wild cards (* and ?).
  *   + Pass the key name of the cache entry.
  *
  * @see wincache_ucache_del();
  * @param string;
  * @return array; The number of cache entries deleted.
  */
 public function delete($search)
 {
     $reg_exp = false;
     if ($this->isSearchRegExp($search)) {
         $reg_exp = $search;
     } else {
         if ($this->isSearchWildCard($search)) {
             $reg_exp = $this->getWildCardRegExp($search);
         }
     }
     $key = $search;
     if (is_string($reg_exp) && count($cache_ids_array = $this->getCacheIdsByRegExp($reg_exp)) > 0) {
         $key = $cache_ids_array;
     }
     if ($result = wincache_ucache_delete($key)) {
         $this->clearInfoArrays();
     }
     return $result;
 }
コード例 #24
0
ファイル: CWinCache.php プロジェクト: charlymanja/traceper
 /**
  * Deletes a value with the specified key from cache
  * This is the implementation of the method declared in the parent class.
  * @param string $key the key of the value to be deleted
  * @return boolean if no error happens during deletion
  */
 protected function deleteValue($key)
 {
     return wincache_ucache_delete($key);
 }
コード例 #25
0
 /**
  * {@inheritdoc}
  */
 public function remove($key)
 {
     return wincache_ucache_delete($key);
 }
コード例 #26
0
ファイル: Wincache.php プロジェクト: CBEPX/yii2-mikrotik
 /**
  * Clears the persistent storage.
  * 
  * Clears the persistent storage, i.e. removes all keys. Locks are left
  * intact.
  * 
  * @return void
  */
 public function clear()
 {
     $info = wincache_ucache_info();
     foreach ($info['ucache_entries'] as $entry) {
         if (!$entry['is_session'] && 0 === strpos($entry['key_name'], $this->persistentId)) {
             wincache_ucache_delete($entry['key_name']);
         }
     }
 }
コード例 #27
0
ファイル: WinCacheStore.php プロジェクト: Thomvh/turbine
 /**
  * Remove an item from the cache.
  *
  * @param  string  $key
  * @return void
  */
 public function forget($key)
 {
     wincache_ucache_delete($this->prefix . $key);
 }
コード例 #28
0
 function delete($id, $group = 'default')
 {
     $key = $this->key($id, $group);
     if (in_array($group, $this->no_mc_groups)) {
         unset($this->cache[$key]);
         return true;
     }
     $result = wincache_ucache_delete($key);
     @++$this->stats['delete'];
     $this->group_ops[$group][] = "delete {$id}";
     unset($this->cache[$key]);
     return $result;
 }
コード例 #29
0
ファイル: WinCacheCache.php プロジェクト: laiello/masfletes
 /**
  * {@inheritdoc}
  */
 protected function doDelete($id)
 {
     return wincache_ucache_delete($id);
 }
コード例 #30
0
ファイル: wincache.php プロジェクト: carmerin/cesae-web
 /**
  * Destroy the data for a particular session identifier in the
  * SessionHandler backend.
  *
  * @param   string   $id  The session identifier.
  *
  * @return boolean  True on success, false otherwise.
  */
 public function destroy($id)
 {
     $sess_id = 'sess_' . $id;
     return wincache_ucache_delete($sess_id);
 }