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


PHP eaccelerator_rm函数代码示例

本文整理汇总了PHP中eaccelerator_rm函数的典型用法代码示例。如果您正苦于以下问题:PHP eaccelerator_rm函数的具体用法?PHP eaccelerator_rm怎么用?PHP eaccelerator_rm使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: clean

 function clean($basedir, $initdir = false, $filename = false)
 {
     if (strlen($filename)) {
         $basedir_version = eaccelerator_get($this->sid . $basedir);
         if ($basedir_version === null) {
             return true;
         }
         if ($initdir !== false) {
             $initdir_version = eaccelerator_get($basedir_version . "|" . $initdir);
             if ($initdir_version === null) {
                 return true;
             }
         } else {
             $initdir_version = "";
         }
         eaccelerator_rm($basedir_version . "|" . $initdir_version . "|" . $filename);
     } else {
         if (strlen($initdir)) {
             $basedir_version = eaccelerator_get($this->sid . $basedir);
             if ($basedir_version === null) {
                 return true;
             }
             eaccelerator_rm($basedir_version . "|" . $initdir);
         } else {
             eaccelerator_rm($this->sid . $basedir);
         }
     }
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:29,代码来源:cache_eaccelerator.php

示例2: delData

 /**
  * Delete cache from shared memory
  *
  * @param  string $sKey - file name
  * @return result of the operation
  */
 function delData($sKey)
 {
     eaccelerator_lock($sKey);
     eaccelerator_rm($sKey);
     eaccelerator_unlock($sKey);
     return true;
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:13,代码来源:BxDolCacheEAccelerator.php

示例3: delete

 public function delete($key)
 {
     if (DEBUG) {
         \Lysine\logger('cache')->debug('Eaccelerator delete key ' . (is_array($key) ? implode(',', $key) : $key));
     }
     $key = $this->makeKey($key);
     return eaccelerator_rm($key);
 }
开发者ID:yeaha,项目名称:lysine,代码行数:8,代码来源:eaccelerator.php

示例4: flush

 public function flush()
 {
     $v9b207167e5381c47682c6b4f58a623fb = eaccelerator_clear();
     $v14f802e1fba977727845e8872c1743a7 = eaccelerator_list_keys();
     foreach ($v14f802e1fba977727845e8872c1743a7 as $v3c6e0b8a9c15224a8228b9a98ca1531d) {
         eaccelerator_rm(substr($v3c6e0b8a9c15224a8228b9a98ca1531d['name'], 1));
     }
     return $v9b207167e5381c47682c6b4f58a623fb;
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:9,代码来源:eaccelerator.php

示例5: delete

 public function delete($id, $tag = FALSE)
 {
     if ($id === TRUE) {
         return eaccelerator_clean();
     }
     if ($tag == FALSE) {
         return eaccelerator_rm($id);
     }
     return TRUE;
 }
开发者ID:mewsop,项目名称:Ushahidi_Web,代码行数:10,代码来源:Eaccelerator.php

示例6: delete

 public function delete($id, $tag = FALSE)
 {
     if ($tag === TRUE) {
         Kohana::log('error', 'tags are unsupported by the eAccelerator driver');
         return FALSE;
     } elseif ($id === TRUE) {
         return eaccelerator_clean();
     } else {
         return eaccelerator_rm($id);
     }
 }
开发者ID:darkcolonist,项目名称:kohana234-doctrine115,代码行数:11,代码来源:Eaccelerator.php

示例7: clean

 public function clean($group, $mode = null)
 {
     $keys = eaccelerator_list_keys();
     $secret = $this->_hash;
     if (is_array($keys)) {
         foreach ($keys as $key) {
             $key['name'] = ltrim($key['name'], ':');
             if (strpos($key['name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') {
                 eaccelerator_rm($key['name']);
             }
         }
     }
     return true;
 }
开发者ID:vanie3,项目名称:appland,代码行数:14,代码来源:eaccelerator.php

示例8: destroy_all

 function destroy_all()
 {
     if (!function_exists('eaccelerator_list_keys')) {
         return;
     }
     $key_list = eaccelerator_list_keys();
     $key_length = strlen($this->key);
     foreach ($key_list as $key) {
         if (strpos($key['name'], $this->key) === 0) {
             eaccelerator_rm($key['name']);
             $this->remove(substr($key['name'], $key_length));
         }
     }
     $this->reset();
 }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:15,代码来源:cache_eaccelerator.php

示例9: destroy

 /**
  * 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 eaccelerator_rm($sess_id);
 }
开发者ID:joomline,项目名称:Joomla2.5.999,代码行数:12,代码来源:eaccelerator.php

示例10: _setExpire

 /**
  * Set expire time on each call since eAccelerator sets it on
  * cache creation.
  *
  * @param string $key        Cache key to expire.
  * @param integer $lifetime  Lifetime of the data in seconds.
  */
 protected function _setExpire($key, $lifetime)
 {
     if ($lifetime == 0) {
         // Don't expire.
         return;
     }
     $expire = eaccelerator_get($key . '_expire');
     // Set prune period.
     if ($expire + $lifetime < time()) {
         // Expired
         eaccelerator_rm($key);
         eaccelerator_rm($key . '_expire');
     }
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:21,代码来源:Eaccelerator.php

示例11: rm

 public function rm($key)
 {
     return eaccelerator_rm($key);
 }
开发者ID:huming17,项目名称:dzmvc,代码行数:4,代码来源:memory_driver_eaccelerator.php

示例12: delete

 function delete($key, $time = 0)
 {
     return eaccelerator_rm($key);
 }
开发者ID:jldupont,项目名称:jldupont.com,代码行数:4,代码来源:Cache.php

示例13: _delete

 /**
  * Remove an item from the cache
  *
  * @access protected
  * @param string $var Cache key
  * @return bool True if the operation succeeded
  */
 function _delete($var)
 {
     return eaccelerator_rm($this->key_prefix . $var);
 }
开发者ID:puring0815,项目名称:OpenKore,代码行数:11,代码来源:acm_eaccelerator.php

示例14: smarty_cache_eaccelerator


//.........这里部分代码省略.........
        if (!is_null($cache_content) && _eaccelerator_hasexpired($cache_content)) {
          // Cache has been expired so we clear it now by calling ourself with another parameter :)
          $cache_content = null;
          smarty_cache_eaccelerator('clear', $smarty, $cache_content, $tpl_file, $cache_id, $compile_id);
        }

        $return = true;
        break;

      case 'write':
        // save cache to shared memory
        $current_time = time();
        if (is_null($exp_time) || $exp_time < $current_time)
          $ttl = 0;
        else
          $ttl = $exp_time - time();

        // First run garbage collection
        eaccelerator_gc();

        // Put content into cache
        eaccelerator_lock($eaccelerator_id);
        eaccelerator_put($eaccelerator_id, $cache_content, $ttl);

        // Create an index association
        eaccelerator_lock($eaccelerator_index_id);
        $eaccelerator_index = eaccelerator_get($eaccelerator_index_id);
        if (!is_array($eaccelerator_index))
          $eaccelerator_index = array();
        $indexes = explode(DIRECTORY_SEPARATOR, $_cache_file);
        $_pointer =& $eaccelerator_index;
        foreach ($indexes as $index) {
          if (!isset($_pointer[$index]))
            $_pointer[$index] = array();
          $_pointer =& $_pointer[$index];
        }
        $_pointer = $eaccelerator_id;
        eaccelerator_put($eaccelerator_index_id, $eaccelerator_index, 0);
        eaccelerator_unlock($eaccelerator_index_id);

        eaccelerator_unlock($eaccelerator_id);
        break;

      case 'clear':
        // clear cache info
        eaccelerator_lock($eaccelerator_index_id);
        $eaccelerator_index = eaccelerator_get($eaccelerator_index_id);
        if (is_array($eaccelerator_index)) {
          if (empty($cache_id) && empty($compile_id) && empty($tpl_file)) {
            // clear all cache
            eaccelerator_lock($eaccelerator_id);
            _eaccelerator_clear_cache($eaccelerator_index);
            eaccelerator_unlock($eaccelerator_id);
            $eaccelerator_index = array();
          }
          else {
            // clear single file or cache group
            $indexes = explode(DIRECTORY_SEPARATOR, $_cache_file);
            if (is_null($tpl_file))
              array_pop($indexes);

            $_pointer =& $eaccelerator_index;
            $_failed = false;
            foreach ($indexes as $index) {
              if (!isset($_pointer[$index])) {
                $_failed = true;
                break;
              }
              $_pointer =& $_pointer[$index];
            }

            if (!$_failed) {
              if (is_array($_pointer)) {
                // Clear cache group
                _eaccelerator_clear_cache($_pointer);
              }
              else {
                // Clear single file
                eaccelerator_lock($_pointer);
                eaccelerator_rm($_pointer);
                eaccelerator_unlock($_pointer);
              }
              $_pointer = null;
            }
          }
        }
        eaccelerator_put($eaccelerator_index_id, $eaccelerator_index, 0);
        eaccelerator_unlock($eaccelerator_index_id);

        $return = true;
        break;

      default:
        // error, unknown action
        $smarty->trigger_error("cache_handler: unknown action \"$action\"");
        $return = false;
        break;
    }
    return $return;
  }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:101,代码来源:cache.eaccelerator.php

示例15: unset_from_mem_cache

/**
 * Remove a given key from the volatile/lossy cache.
 *
 * @param string key
 * @return boolean True on success, false on failure. NULL if no backend available.
 */
function unset_from_mem_cache($key)
{
    if (function_exists('apc_delete')) {
        return apc_delete($key);
    }
    if (function_exists('xcache_unset')) {
        return xcache_unset(gen_key_for_cache($key));
    }
    if (function_exists('eaccelerator_rm')) {
        return eaccelerator_rm(gen_key_for_cache($key));
    }
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:18,代码来源:_misc.funcs.php


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