當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。