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


PHP eaccelerator_put函数代码示例

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


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

示例1: set

 /**
  * Set a value based on an id. Optionally add tags.
  * 
  * @param   string   id 
  * @param   mixed    data 
  * @param   integer  lifetime [Optional]
  * @return  boolean
  */
 public function set($id, $data, $lifetime = NULL)
 {
     if (NULL === $lifetime) {
         $lifetime = time() + $this->_default_expire;
     }
     return eaccelerator_put($this->sanitize_id($id), $data, $lifetime);
 }
开发者ID:sfgeorge,项目名称:kohana-cache,代码行数:15,代码来源:eaccelerator.php

示例2: set

 public function set($id, $data, array $tags = NULL, $lifetime)
 {
     if (!empty($tags)) {
         Kohana::log('error', 'tags are unsupported by the eAccelerator driver');
     }
     return eaccelerator_put($id, $data, $lifetime);
 }
开发者ID:darkcolonist,项目名称:kohana234-doctrine115,代码行数:7,代码来源:Eaccelerator.php

示例3: set

 /**
  * Set cache
  *
  * @param string $key
  * @param mixed $value
  * @param int $ttl
  * @return boolean
  */
 public function set($key, $value, $ttl = null)
 {
     if (null === $ttl) {
         $ttl = $this->_options['ttl'];
     }
     return eaccelerator_put($key, $value, $ttl);
 }
开发者ID:Robert-Xie,项目名称:php-framework-benchmark,代码行数:15,代码来源:Eaccelerator.php

示例4: put

 /**
  * Write an item to the cache.
  *
  * @param string The name of the cache
  * @param mixed The data to write to the cache item
  * @return boolean True on success, false on failure
  */
 function put($name, $contents)
 {
     eaccelerator_lock($this->unique_id . "_" . $name);
     $status = eaccelerator_put($this->unique_id . "_" . $name, serialize($contents));
     eaccelerator_unlock($this->unique_id . "_" . $name);
     return $status;
 }
开发者ID:Nidrax,项目名称:ppm-1.6,代码行数:14,代码来源:eaccelerator.php

示例5: set

 /**
  * 写入缓存
  * @access public
  * @param string $name 缓存变量名
  * @param mixed $value  存储数据
  * @param integer $expire  有效时间(秒)
  * @return boolen
  */
 public function set($name, $value, $expire = null)
 {
     \think\Cache::$writeTimes++;
     if (is_null($expire)) {
         $expire = $this->options['expire'];
     }
     $name = $this->options['prefix'] . $name;
     eaccelerator_lock($name);
     if (eaccelerator_put($name, $value, $expire)) {
         if ($this->options['length'] > 0) {
             // 记录缓存队列
             $queue = eaccelerator_get('__info__');
             if (!$queue) {
                 $queue = [];
             }
             if (false === array_search($name, $queue)) {
                 array_push($queue, $name);
             }
             if (count($queue) > $this->options['length']) {
                 // 出列
                 $key = array_shift($queue);
                 // 删除缓存
                 eaccelerator_rm($key);
             }
             eaccelerator_put('__info__', $queue);
         }
         return true;
     }
     return false;
 }
开发者ID:zhaomingliang,项目名称:think,代码行数:38,代码来源:eaccelerator.php

示例6: set

 /**
  * Set a value based on an id. Optionally add tags.
  * 
  * @param   string   id 
  * @param   mixed    data 
  * @param   integer  lifetime [Optional]
  * @return  boolean
  */
 public function set($id, $data, $lifetime = NULL)
 {
     if ($lifetime === NULL) {
         $lifetime = time() + Arr::get($this->_config, 'default_expire', Cache::DEFAULT_EXPIRE);
     }
     return eaccelerator_put($this->_sanitize_id($id), $data, $lifetime);
 }
开发者ID:practicalwebdev,项目名称:openreach,代码行数:15,代码来源:eaccelerator.php

示例7: getClassPath

function getClassPath()
{
    static $classpath = array();
    if (!empty($classpath)) {
        return $classpath;
    }
    if (function_exists("apc_fetch")) {
        $classpath = apc_fetch("fw:root:autoload:map:1397705849");
        if ($classpath) {
            return $classpath;
        }
        $classpath = getClassMapDef();
        apc_store("fw:root:autoload:map:1397705849", $classpath);
    } else {
        if (function_exists("eaccelerator_get")) {
            $classpath = eaccelerator_get("fw:root:autoload:map:1397705849");
            if ($classpath) {
                return $classpath;
            }
            $classpath = getClassMapDef();
            eaccelerator_put("fw:root:autoload:map:1397705849", $classpath);
        } else {
            $classpath = getClassMapDef();
        }
    }
    return $classpath;
}
开发者ID:sdgdsffdsfff,项目名称:qconf-inner,代码行数:27,代码来源:auto_load.php

示例8: set

 /**
  */
 public function set($key, $data, $lifetime = 0)
 {
     $key = $this->_params['prefix'] . $key;
     if (eaccelerator_put($key . '_expire', time(), $lifetime)) {
         eaccelerator_put($key, $data, $lifetime);
     }
 }
开发者ID:raz0rsdge,项目名称:horde,代码行数:9,代码来源:Eaccelerator.php

示例9: putInCache

 /**
  * Put data into remote cache store
  *
  * @param	string		Cache unique key
  * @param	string		Cache value to add
  * @param	integer		[Optional] Time to live
  * @return	@e boolean
  */
 public function putInCache($key, $value, $ttl = 0)
 {
     eaccelerator_lock(md5($this->identifier . $key));
     $check = eaccelerator_put(md5($this->identifier . $key), $value, intval($ttl));
     eaccelerator_unlock(md5($this->identifier . $key));
     return $check;
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:15,代码来源:classCacheEaccelerator.php

示例10: add

 /**
  * add
  * @param string $key
  * @param string|array|object $value
  * @param int $ttl
  * @param string $tableName
  * @param resource $connectionResource
  * @return boolean
  */
 public function add($key, $value, $ttl = 0, $tableName = '', $connectionResource = null)
 {
     $connectionResource = null;
     $value = serialize($value);
     //eAccelerator doesn't serialize object
     return eaccelerator_put($this->getRealKey($tableName, $key), $value, $ttl);
 }
开发者ID:zhangshijle,项目名称:Python3,代码行数:16,代码来源:CacheAdapterEAccelerator.php

示例11: set

 public function set($key, $value, $ttl)
 {
     $expires = $_SERVER['REQUEST_TIME'] + $ttl;
     // prepend the application expiration time to the value and save
     // the value to cache. the "real" timeout is far in the future.
     eaccelerator_put($key, "{$expires}:{$value}", 3600);
     // 1 hour
 }
开发者ID:hellogerard,项目名称:pox-framework,代码行数:8,代码来源:Dogpile.php

示例12: setMulti

 public function setMulti($items, $ttl = 0)
 {
     $status = FALSE;
     foreach ($items as $key => $value) {
         $status = eaccelerator_put($key, $value, $ttl);
     }
     return $status;
 }
开发者ID:Kami,项目名称:Multi-Storage-Cache,代码行数:8,代码来源:EAccelerator.php

示例13: set

 /**
  * 设置一个缓存变量
  *
  * @access public
  *
  * @param string $key 缓存Key
  * @param mixed $value 缓存内容
  * @param int $expire 缓存时间(秒)
  *
  * @return boolean
  */
 public function set($key, $value, $expire = null)
 {
     //参数分析
     if (!$key) {
         return false;
     }
     $expire = is_null($expire) ? $this->_defaultOptions['expire'] : $expire;
     return eaccelerator_put($key, $value, $expire);
 }
开发者ID:a53abc,项目名称:doitphp,代码行数:20,代码来源:Cache_Eaccelerator.class.php

示例14: put

 function put($name, $data, $ttl = 604800)
 {
     $ttl = (int) $ttl ? (int) $ttl : 604800;
     if (eaccelerator_lock($this->key . $name)) {
         eaccelerator_put($this->key . $name, serialize($data), $ttl);
         eaccelerator_unlock($this->key . $name);
     }
     $this->vars[$name] = $data;
 }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:9,代码来源:cache_eaccelerator.php

示例15: set

 public function set($key, $value, $type = '', $ttl = SESSION_EXPIRE)
 {
     $this->type = $type;
     $name = $this->_key($key);
     eaccelerator_lock($name);
     if (eaccelerator_put($name, $value, $ttl)) {
         return true;
     }
     return false;
 }
开发者ID:norain2050,项目名称:xingkang,代码行数:10,代码来源:cache.eaccelerator.php


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