当前位置: 首页>>代码示例>>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;未经允许,请勿转载。