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


PHP resource::delete方法代码示例

本文整理汇总了PHP中resource::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP resource::delete方法的具体用法?PHP resource::delete怎么用?PHP resource::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在resource的用法示例。


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

示例1: deleteCacheData

 /**
  * Delete a cell in cache identified by coordinate address
  *
  * @param    string $pCoord Coordinate address of the cell to delete
  *
  * @throws    PHPExcel_Exception
  */
 public function deleteCacheData($pCoord)
 {
     //	Delete the entry from Memcache
     $this->_memcache->delete($this->_cachePrefix . $pCoord . '.cache');
     //	Delete the entry from our cell address array
     parent::deleteCacheData($pCoord);
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:14,代码来源:Memcache.php

示例2: processJobData

 /**
  * 处理任务数据的回调方法
  * @param function $callback
  * @param resource $vendorInstance
  * @param array $option
  * @throws MyRuntimeException
  */
 public static function processJobData($callback, $vendorInstance, $option = array())
 {
     $option += array('decode' => TRUE, 'delete' => TRUE, 'release' => FALSE, 'delay' => 10, 'priority' => 1024, 'timeout' => NULL);
     $retData = NULL;
     //echo 'proceed job data'.PHP_EOL;
     //var_dump($vendorInstance);
     $job = $vendorInstance->reserve($option['timeout']);
     //var_dump($job);
     if ($job) {
         if ($option['decode'] == TRUE) {
             $arg = self::decodeData($job->getData());
         } else {
             $arg = $job->getData();
         }
         if (!is_callable($callback)) {
             throw new RuntimeException('process data error');
         }
         $retData = call_user_func($callback, $arg);
         if (!$retData) {
             if ($option['release'] == TRUE) {
                 $vendorInstance->release($job, $option['priority'], $option['delay']);
             }
             throw new RuntimeException('process data error');
         }
         if ($option['delete'] == TRUE) {
             $vendorInstance->delete($job);
         }
     } else {
         $arg = $job;
     }
     return $retData;
 }
开发者ID:nickfan,项目名称:appbox,代码行数:39,代码来源:BeanstalkBoxRouteServiceDriver.php

示例3: __destruct

 /**
  * Destroy this cell collection
  */
 public function __destruct()
 {
     $cacheList = $this->getCellList();
     foreach ($cacheList as $cellID) {
         $this->_memcache->delete($this->_cachePrefix . $cellID . '.cache');
     }
 }
开发者ID:arjunkumar786,项目名称:faces,代码行数:10,代码来源:Memcache.php

示例4: releaseLock

 /**
  * Releases a lock on the given $key. 
  * 
  * @param string $key 
  * @return void
  */
 public function releaseLock($key)
 {
     if (strlen($key) > self::MAX_KEY_LENGTH) {
         throw new ezcCacheInvalidKeyException($key, 'Length > ' . self::MAX_KEY_LENGTH . '.');
     }
     $this->memcache->delete($key);
 }
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:13,代码来源:memcache_backend.php

示例5: remove

 /**
  * 删除缓存
  * [code]
  * $memcache->remove('key');
  * $memcache->remove(array('key1', 'key2'));
  * [/code]
  *
  * @access public
  * @return void
  */
 public function remove($keys)
 {
     if (is_array($keys)) {
         while (list(, $key) = each($keys)) {
             $this->remove($key);
         }
     } else {
         $this->_conn->delete($keys);
     }
 }
开发者ID:Debenson,项目名称:openwan,代码行数:20,代码来源:memcached.php

示例6: destroy

 /**
  * Destroy
  *
  * Destroys the current session.
  *
  * @param	string	$session_id	Session ID
  * @return	bool
  */
 public function destroy($session_id)
 {
     if (isset($this->_redis, $this->_lock_key)) {
         if (($result = $this->_redis->delete($this->_key_prefix . $session_id)) !== 1) {
             log_message('debug', 'Session: Redis::delete() expected to return 1, got ' . var_export($result, TRUE) . ' instead.');
         }
         $this->_cookie_destroy();
         return $this->_success;
     }
     return $this->_fail();
 }
开发者ID:jimok82,项目名称:CIOpenReview,代码行数:19,代码来源:Session_redis_driver.php

示例7: _release_lock

 /**
  * Release lock
  *
  * Releases a previously acquired lock
  *
  * @return	bool
  */
 protected function _release_lock()
 {
     if (isset($this->_redis, $this->_lock_key) && $this->_lock) {
         if (!$this->_redis->delete($this->_lock_key)) {
             return FALSE;
         }
         $this->_lock_key = NULL;
         $this->_lock = FALSE;
     }
     return TRUE;
 }
开发者ID:evolutionscript,项目名称:CI_Session,代码行数:18,代码来源:Session_redis_driver.php

示例8: _setExpire

 /**
  * Set expire time on each call since memcached sets it on cache creation.
  *
  * @param   string  $key  Cache key to expire.
  *
  * @return  void
  *
  * @since   11.1
  */
 protected function _setExpire($key)
 {
     $lifetime = ini_get("session.gc_maxlifetime");
     $expire = $this->_db->get($key . '_expire');
     // Set prune period
     if ($expire + $lifetime < time()) {
         $this->_db->delete($key);
         $this->_db->delete($key . '_expire');
     } else {
         $this->_db->replace($key . '_expire', time());
     }
 }
开发者ID:nogsus,项目名称:joomla-platform,代码行数:21,代码来源:memcached.php

示例9: releaseLock

 /**
  * Release lock
  *
  * Releases a previously acquired lock
  *
  * @return	bool
  */
 protected function releaseLock() : bool
 {
     if (isset($this->redis, $this->lockKey) && $this->lock) {
         if (!$this->redis->delete($this->lockKey)) {
             $this->logger->error('Session: Error while trying to free lock for ' . $this->lockKey);
             return FALSE;
         }
         $this->lockKey = NULL;
         $this->lock = FALSE;
     }
     return TRUE;
 }
开发者ID:titounnes,项目名称:CodeIgniter4,代码行数:19,代码来源:RedisHandler.php

示例10: time

 /**
  * Set expire time on each call since memcache sets it on cache creation.
  *
  * @access private
  *
  * @param string  $key   Cache key to expire.
  * @param integer $lifetime  Lifetime of the data in seconds.
  */
 function _setExpire($key)
 {
     $lifetime = $this->_lifetime;
     $expire = $this->_db->get($key . '_expire');
     // set prune period
     if ($expire + $lifetime < time()) {
         $this->_db->delete($key);
         $this->_db->delete($key . '_expire');
     } else {
         $this->_db->replace($key . '_expire', time());
     }
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:20,代码来源:memcache.php

示例11: _release_lock

 /**
  * Release lock.
  *
  * Releases a previously acquired lock
  *
  * @return bool
  */
 protected function _release_lock()
 {
     if (isset($this->_redis, $this->_lock_key) && $this->_lock) {
         if (!$this->_redis->delete($this->_lock_key)) {
             log_message('error', 'Session: Error while trying to free lock for ' . $this->_lock_key);
             return false;
         }
         $this->_lock_key = null;
         $this->_lock = false;
     }
     return true;
 }
开发者ID:recca0120,项目名称:laraigniter,代码行数:19,代码来源:Session_redis_driver.php

示例12: _release_lock

 /**
  * Release lock
  *
  * Releases a previously acquired lock
  *
  * @return	bool
  */
 protected function _release_lock()
 {
     if (isset($this->_redis, $this->_lock_key) && $this->_lock) {
         if (!$this->_redis->delete($this->_lock_key)) {
             log_message('error', 'Session: Error while trying to free lock for ' . $this->_lock_key);
             return FALSE;
         }
         $this->_lock_key = NULL;
         $this->_lock = FALSE;
     }
     return TRUE;
 }
开发者ID:wms-code,项目名称:CodeIgniter-admin,代码行数:19,代码来源:Session_redis_driver.php

示例13: _releaseLock

 /**
  * 释放资源锁
  * @param string $key 缓存锁键
  * @param string $server_key 指定服务器
  * @return bool
  */
 private function _releaseLock($keys, $server_key = null)
 {
     $keys = $this->_buildKey($keys, 'LOCK_CTL');
     $calls = 0;
     if (is_array($keys)) {
         if (is_null($server_key)) {
             $this->mcd->deleteMulti($keys);
         } else {
             $this->mcd->deleteMultiByKey($server_key, $keys);
         }
         $calls += count($keys);
     } else {
         if (is_null($server_key)) {
             $this->mcd->delete($keys);
         } else {
             $this->mcd->deleteByKey($server_key, $keys);
         }
         $calls++;
     }
     BaseModelCommon::addStatInfo('mc', 0, $calls);
 }
开发者ID:az0ne,项目名称:diaoyu,代码行数:27,代码来源:BaseModelMemcached.php

示例14: delete

 /**
  * Deletes a file or directory on the SFTP/FTP server.
  *
  * @param string $path
  * @param bool   $recursive if $path is a directory, it will delete also its content
  *
  * @return bool
  */
 public function delete($path, $recursive = true)
 {
     switch ($this->_connType) {
         case SftpHelper::TYPE_SFTP:
         default:
             $res = $this->_connection->delete($path, $recursive);
             break;
         case SftpHelper::TYPE_FTP:
             $res = @ftp_delete($this->_connection, $path);
             if (!$res && $recursive) {
                 $list = @ftp_nlist($this->_connection, $path);
                 // if $path exists and it is a directory:
                 if (!empty($list)) {
                     foreach ($list as $file) {
                         $this->delete($file, true);
                     }
                     // deleting the parent path after the recursion
                     $res = $this->delete($path, false);
                 }
             }
             break;
     }
     return $res;
 }
开发者ID:giovdk21,项目名称:deployii,代码行数:32,代码来源:SftpHelper.php

示例15: releaseLock

 /**
  * 释放资源锁
  * @param string $key 缓存锁键
  */
 public function releaseLock($key)
 {
     $this->mc->delete($key . self::CACHE_LOCK_CTL);
 }
开发者ID:az0ne,项目名称:diaoyu,代码行数:8,代码来源:BaseModelMemcache.php


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