當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wincache_ucache_add函數代碼示例

本文整理匯總了PHP中wincache_ucache_add函數的典型用法代碼示例。如果您正苦於以下問題:PHP wincache_ucache_add函數的具體用法?PHP wincache_ucache_add怎麽用?PHP wincache_ucache_add使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了wincache_ucache_add函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: set

 /**
  * @param string $key
  * @param mixed $value
  * @param integer $ttl
  * @return mixed
  */
 public function set($key, $value, $ttl = null)
 {
     if (!$this->exists($key)) {
         return wincache_ucache_add($keyword, $value, null === $ttl ? 0 : $ttl);
     }
     return wincache_ucache_set($keyword, $value, null === $ttl ? 0 : $ttl);
 }
開發者ID:mactronique,項目名稱:phpcache,代碼行數:13,代碼來源:WincacheDriver.php

示例2: add

 /**
  * Adds a new item that is to be cached
  *
  * @param string $key
  * @param mixed $data
  * @param bool $overwrite
  * @return bool
  */
 public function add($key, $data, $overwrite = false)
 {
     if ($overwrite == false) {
         return wincache_ucache_add($key, $data, $this->ttl());
     } else {
         return wincache_ucache_set($key, $data, $this->ttl());
     }
 }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:16,代碼來源:Wincache.php

示例3: add

 public function add($key, $var, $expire= 0, $options= array()) {
     $added= wincache_ucache_add(
         $this->getCacheKey($key),
         $var,
         $expire
     );
     return $added;
 }
開發者ID:raf3600,項目名稱:revolution,代碼行數:8,代碼來源:xpdowincache.class.php

示例4: driver_set

 function driver_set($keyword, $value = "", $time = 300, $option = array())
 {
     if (isset($option['skipExisting']) && $option['skipExisting'] == true) {
         return wincache_ucache_add($keyword, $value, $time);
     } else {
         return wincache_ucache_set($keyword, $value, $time);
     }
 }
開發者ID:rylanb,項目名稱:Play-Later,代碼行數:8,代碼來源:wincache.php

示例5: store

 public function store($key, $value, $overwrite, $ttl = 0)
 {
     if ($overwrite) {
         return wincache_ucache_set($key, $value, $ttl);
     } else {
         // emits a warning if the key already exists
         return @wincache_ucache_add($key, $value, $ttl);
     }
 }
開發者ID:kuria,項目名稱:cache,代碼行數:9,代碼來源:WinCacheDriver.php

示例6: _storeData

 private function _storeData()
 {
     $this->_currentObject->detach();
     $obj = serialize($this->_currentObject);
     if (wincache_ucache_exists($this->_cachePrefix . $this->_currentObjectID . '.cache')) {
         wincache_ucache_set($this->_cachePrefix . $this->_currentObjectID . '.cache', $obj, $this->_cacheTime);
     } else {
         wincache_ucache_add($this->_cachePrefix . $this->_currentObjectID . '.cache', $obj, $this->_cacheTime);
     }
     $this->_currentObjectID = $this->_currentObject = null;
 }
開發者ID:kumarsivarajan,項目名稱:ctrl-dock,代碼行數:11,代碼來源:Wincache.php

示例7: put

 /**
  * Write an item to the cache for a given number of minutes.
  *
  * <code>
  *    // Put an item in the cache for 15 minutes
  *    Cache::put('name', 'Robin', 15);
  * </code>
  *
  * @param string $key
  * @param mixed  $value
  * @param int    $minutes
  *
  * @return bool|void
  */
 public function put($key, $value, $minutes)
 {
     return wincache_ucache_add($this->key . $key, $value, $minutes * 60);
 }
開發者ID:PermeAgility,項目名稱:FrameworkBenchmarks,代碼行數:18,代碼來源:Wincache.php

示例8: addValues

 /**
  * Adds multiple key-value pairs to cache.
  * The default implementation calls [[addValue()]] multiple times add values one by one. If the underlying cache
  * storage supports multiadd, this method should be overridden to exploit that feature.
  * @param array $data array where key corresponds to cache key while value is the value stored
  * @param integer $expire the number of seconds in which the cached values will expire. 0 means never expire.
  * @return array array of failed keys
  */
 protected function addValues($data, $expire)
 {
     return wincache_ucache_add($data, null, $expire);
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:12,代碼來源:WinCache.php

示例9: put

 /**
  * Store an item in the cache for a given number of minutes.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @param  int     $minutes
  * @return void
  */
 public function put($key, $value, $minutes)
 {
     wincache_ucache_add($this->prefix . $key, $value, $minutes * 60);
 }
開發者ID:Thomvh,項目名稱:turbine,代碼行數:12,代碼來源:WinCacheStore.php

示例10: addValue

 /**
  * Stores a value identified by a key into cache if the cache does not contain this key.
  * This is the implementation of the method declared in the parent class.
  *
  * @param string $key the key identifying the value to be cached
  * @param string $value the value to be cached
  * @param integer $expire the number of seconds in which the cached value will expire. 0 means never expire.
  * @return boolean true if the value is successfully stored into cache, false otherwise
  */
 protected function addValue($key, $value, $expire)
 {
     return wincache_ucache_add($key, $value, $expire);
 }
開發者ID:charlymanja,項目名稱:traceper,代碼行數:13,代碼來源:CWinCache.php

示例11: storeItem

 /**
  * Store an item in the cache for a given number of minutes.
  *
  * @param  string  $key
  * @param  mixed   $value
  * @param  int     $minutes
  * @return void
  */
 protected function storeItem($key, $value, $minutes)
 {
     wincache_ucache_add($this->prefix . $key, $value, $minutes * 60);
 }
開發者ID:defra91,項目名稱:levecchiecredenze.it,代碼行數:12,代碼來源:WinCacheStore.php

示例12: _doSave

 /**
  * Save a cache record directly. This method is implemented by the cache
  * drivers and used in Doctrine_Cache_Driver::save()
  *
  * @param string $id        cache id
  * @param string $data      data to cache
  * @param int $lifeTime     if != false, set a specific lifetime for this cache record (null => infinite lifeTime)
  * @return boolean true if no problem
  */
 protected function _doSave($id, $data, $lifeTime = false)
 {
     return wincache_ucache_add($id, $data, (int) $lifeTime);
 }
開發者ID:juokaz,項目名稱:wincache-adapters,代碼行數:13,代碼來源:WinCache.php

示例13: add

 /**
  * Add to the cache
  *
  * Add a new variable to the cache that you will then be able
  * to retrieve using the $this->get($name) method.
  *
  * @param  string  $name   The name of the cache variable to store.
  * @param  string  $value  The value of the cache variable to store.
  * @param  integer $expire When should it expire? Default: 900 seconds.
  * 
  * @return boolean       Depending on the success of the operation, 
  *                       either true or false. 
  */
 public function add($name, $value, $expiry = 900)
 {
     return wincache_ucache_add($name, $value, $expiry);
 }
開發者ID:jeremykendall,項目名稱:frapi,代碼行數:17,代碼來源:Wincache.php

示例14: add

 /**
  * 緩存一個變量到數據存儲
  *
  * @access public
  *
  * @param string $key 數據key
  * @param mixed $value 數據值
  * @param int $expire 緩存時間(秒)
  *
  * @return boolean
  */
 public function add($key, $value, $expire = null)
 {
     //參數分析
     if (!$key) {
         return false;
     }
     $expire = is_null($expire) ? $this->_defaultOptions['expire'] : $expire;
     return wincache_ucache_add($key, $value, $expire);
 }
開發者ID:a53abc,項目名稱:doitphp,代碼行數:20,代碼來源:Cache_Wincache.class.php

示例15: addItems

 /**
  * Add multiple items.
  *
  * Options:
  *  - namespace <string> optional
  *    - The namespace to use (Default: namespace of object)
  *  - tags <array> optional
  *    - An array of tags
  *
  * @param  array $keyValuePairs
  * @param  array $options
  * @return boolean
  * @throws Exception
  *
  * @triggers addItems.pre(PreEvent)
  * @triggers addItems.post(PostEvent)
  * @triggers addItems.exception(ExceptionEvent)
  */
 public function addItems(array $keyValuePairs, array $options = array())
 {
     $baseOptions = $this->getOptions();
     if (!$baseOptions->getWritable()) {
         return false;
     }
     $this->normalizeOptions($options);
     $args = new ArrayObject(array('keyValuePairs' => &$keyValuePairs, 'options' => &$options));
     try {
         $eventRs = $this->triggerPre(__FUNCTION__, $args);
         if ($eventRs->stopped()) {
             return $eventRs->last();
         }
         $internalKeyValuePairs = array();
         $prefix = $options['namespace'] . $baseOptions->getNamespaceSeparator();
         foreach ($keyValuePairs as $key => &$value) {
             $internalKey = $prefix . $key;
             $internalKeyValuePairs[$internalKey] =& $value;
         }
         $errKeys = wincache_ucache_add($internalKeyValuePairs, null, $options['ttl']);
         if ($errKeys !== array()) {
             throw new Exception\RuntimeException("wincache_ucache_add(<array>, null, {$options['ttl']}) failed for keys: " . "'" . implode("','", array_keys($errKeys)) . "'");
         }
         $result = true;
         return $this->triggerPost(__FUNCTION__, $args, $result);
     } catch (\Exception $e) {
         return $this->triggerException(__FUNCTION__, $args, $e);
     }
 }
開發者ID:navtis,項目名稱:xerxes-pazpar2,代碼行數:47,代碼來源:WinCache.php


注:本文中的wincache_ucache_add函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。