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


PHP zend_disk_cache_store函數代碼示例

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


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

示例1: zdcStore

 /**
  * Store data into Zend Data Disk Cache
  *
  * @param  string $internalKey
  * @param  mixed  $value
  * @param  int    $ttl
  * @return void
  * @throws Exception\RuntimeException
  */
 protected function zdcStore($internalKey, $value, $ttl)
 {
     if (!zend_disk_cache_store($internalKey, $value, $ttl)) {
         $valueType = gettype($value);
         throw new Exception\RuntimeException("zend_disk_cache_store({$internalKey}, <{$valueType}>, {$ttl}) failed");
     }
 }
開發者ID:brikou,項目名稱:zend_cache,代碼行數:16,代碼來源:ZendServerDisk.php

示例2: _store

 /**
  * Store data
  *
  * @param mixed  $data        Object to store
  * @param string $id          Cache id
  * @param int    $timeToLive  Time to live in seconds
  * @return boolean true if no problem
  */
 protected function _store($data, $id, $timeToLive)
 {
     if (zend_disk_cache_store($this->_options['namespace'] . '::' . $id, $data, $timeToLive) === false) {
         $this->_log('Store operation failed.');
         return false;
     }
     return true;
 }
開發者ID:rexmac,項目名稱:zf2,代碼行數:16,代碼來源:Disk.php

示例3: driverWrite

 /**
  * @param \Psr\Cache\CacheItemInterface $item
  * @return mixed
  * @throws \InvalidArgumentException
  */
 protected function driverWrite(CacheItemInterface $item)
 {
     /**
      * Check for Cross-Driver type confusion
      */
     if ($item instanceof Item) {
         $ttl = $item->getExpirationDate()->getTimestamp() - time();
         return zend_disk_cache_store($item->getKey(), $this->driverPreWrap($item), $ttl > 0 ? $ttl : 0);
     } else {
         throw new \InvalidArgumentException('Cross-Driver type confusion detected');
     }
 }
開發者ID:jigoshop,項目名稱:Jigoshop2,代碼行數:17,代碼來源:Driver.php

示例4: 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 zend_disk_cache_store($name, $value, $expiry);
 }
開發者ID:crlang44,項目名稱:frapi,代碼行數:17,代碼來源:Zenddisk.php

示例5: set

 public function set($key, $value, $ttl = 0)
 {
     $safeKey = $this->makeKey($key);
     $ret = @zend_disk_cache_store($safeKey, $value, $ttl);
     return $ret;
 }
開發者ID:chrismcmacken,項目名稱:phptools,代碼行數:6,代碼來源:Disk.php

示例6: put

 /**
  * {@inheritdoc}
  */
 public function put($key, $data, $ttl = 0)
 {
     return zend_disk_cache_store($key, $data, $ttl);
 }
開發者ID:muhammetardayildiz,項目名稱:framework,代碼行數:7,代碼來源:ZendDisk.php

示例7: _set

 protected function _set($key, $data, $ttl)
 {
     if (zend_disk_cache_store($this->key($key), $data, $ttl) === false) {
         throw new \fluxbb\cache\Exception('Unable to write Zend Disk cache: ' . $key);
     }
 }
開發者ID:liulingfu,項目名稱:madserve,代碼行數:6,代碼來源:ZendDisk.php

示例8: write

 /**
  * Write datas on $uid key
  * @param mixed $uid
  * @param mixed $mixed
  */
 public function write($uid, $mixed)
 {
     return zend_disk_cache_store($uid, $mixed);
 }
開發者ID:cityware,項目名稱:city-shared-memory,代碼行數:9,代碼來源:ZendDiskCache.php


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