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


PHP resource::close方法代碼示例

本文整理匯總了PHP中resource::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP resource::close方法的具體用法?PHP resource::close怎麽用?PHP resource::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在resource的用法示例。


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

示例1: disconnect

 /**
  * Closes the FTP connection
  *
  * @return boolean
  */
 function disconnect()
 {
     if ($this->archive) {
         $this->archive->close();
         $this->archive = null;
     }
     return true;
 }
開發者ID:sassman,項目名稱:deployment_shell,代碼行數:13,代碼來源:archive_deployment_destination.php

示例2: tickProcessor

 private function tickProcessor()
 {
     while (!$this->server->isShutdown()) {
         $start = microtime(true);
         $this->tick();
         $time = microtime(true);
         if ($time - $start < 0.01) {
             @time_sleep_until($time + 0.01 - ($time - $start));
         }
     }
     $this->tick();
     $this->socket->close();
 }
開發者ID:iTXTech,項目名稱:Genisys,代碼行數:13,代碼來源:ServerConnection.php

示例3: __destruct

 /**
  * Destroy this cell collection
  */
 public function __destruct()
 {
     if (!is_null($this->_DBHandle)) {
         $this->_DBHandle->close();
     }
     $this->_DBHandle = null;
 }
開發者ID:JaeHoYun,項目名稱:generatedata,代碼行數:10,代碼來源:SQLite3.php

示例4: __destruct

 /**
  * Destroy this cell collection
  */
 public function __destruct()
 {
     if (!is_null($this->_DBHandle)) {
         $this->_DBHandle->exec('DROP TABLE kvp_' . $this->_TableName);
         $this->_DBHandle->close();
     }
     $this->_DBHandle = null;
 }
開發者ID:Troutzorz,項目名稱:csapp,代碼行數:11,代碼來源:SQLite3.php

示例5: __destruct

 /**
  * Destructor for the Memcache backend.
  */
 public function __destruct()
 {
     self::$connectionCounter[$this->connectionIdentifier]--;
     // Save to ignore persistent connections, since close() does not affect them
     if (self::$connectionCounter[$this->connectionIdentifier] === 0) {
         $this->memcache->close();
     }
 }
開發者ID:jacomyma,項目名稱:GEXF-Atlas,代碼行數:11,代碼來源:memcache_backend.php

示例6: disconnect

 /**
  * Disconnects this connection
  * @return null
  */
 public function disconnect()
 {
     if (!$this->isConnected()) {
         return;
     }
     $this->connection->close();
     $this->connection = null;
 }
開發者ID:BGCX261,項目名稱:zibo-svn-to-git,代碼行數:12,代碼來源:SqliteDriver.php

示例7: quit

 /**
  * Sends a QUIT command to the irc server and closes the socket
  * 
  * @param string $quitmsg Quit message
  *
  * @return booolean True on success
  */
 public function quit($quitmsg)
 {
     global $ircNetworks;
     $this->raw(sprintf('QUIT :%s', $quitmsg));
     logWrite(L_SYSTEM, sprintf('[IRC] Disconnecting from %s (%s:%s)', $this->network, $this->server['server'], $this->server['port']));
     $this->socket->close();
     if (isset($ircNetworks[$this->network])) {
         unset($ircNetworks[$this->network]);
     }
     return true;
 }
開發者ID:bonan,項目名稱:neotor,代碼行數:18,代碼來源:irc.php

示例8: recvData

 /**
  * 從服務端接收數據
  * @throws Exception
  */
 public function recvData()
 {
     if (self::$useSwoole) {
         $res = $this->swooleClient->recv();
         $this->swooleClient->close();
     } else {
         $res = fgets($this->connection);
         $this->closeConnection();
     }
     if (!$res) {
         throw new Exception("recvData empty");
     }
     return JsonProtocol::decode($res);
 }
開發者ID:stonegithubs,項目名稱:swoole-JsonRPC,代碼行數:18,代碼來源:RpcClient.php

示例9: close

 /**
  * Close
  *
  * Releases locks and closes connection.
  *
  * @return	bool
  */
 public function close()
 {
     if (isset($this->_redis)) {
         try {
             if ($this->_redis->ping() === '+PONG') {
                 isset($this->_lock_key) && $this->_redis->delete($this->_lock_key);
                 if (!$this->_redis->close()) {
                     return FALSE;
                 }
             }
         } catch (RedisException $e) {
         }
         $this->_redis = NULL;
         return TRUE;
     }
     return TRUE;
 }
開發者ID:evolutionscript,項目名稱:CI_Session,代碼行數:24,代碼來源:Session_redis_driver.php

示例10: close

 /**
  * Close
  *
  * Releases locks and closes connection.
  *
  * @return	bool
  */
 public function close()
 {
     if (isset($this->_redis)) {
         try {
             if ($this->_redis->ping() === '+PONG') {
                 $this->_release_lock();
                 if ($this->_redis->close() === FALSE) {
                     return $this->_fail();
                 }
             }
         } catch (RedisException $e) {
             log_message('error', 'Session: Got RedisException on close(): ' . $e->getMessage());
         }
         $this->_redis = NULL;
         return $this->_success;
     }
     return $this->_success;
 }
開發者ID:xiaokunliu,項目名稱:php_project,代碼行數:25,代碼來源:Session_redis_driver.php

示例11: setCursor

 /**
  * sets the statement cursor to key
  * 
  * @param int $k
  * @return boolean
  */
 public function setCursor($k)
 {
     if (isset($this->result) && $this->result) {
         $this->result->close();
     }
     if ($k != $this->_i) {
         @$this->_statement[$this->_i]->free_result();
     }
     $this->_bound = array();
     if (!is_array($this->_statement)) {
         return false;
     }
     if (!array_key_exists($k, $this->_statement)) {
         return false;
     }
     $this->_i = $k;
     return true;
 }
開發者ID:gpuenteallott,項目名稱:rox,代碼行數:24,代碼來源:db_statement_mysqli.lib.php

示例12: close

 /**
  * Close
  *
  * Releases locks and closes connection.
  *
  * @return	bool
  */
 public function close()
 {
     if (isset($this->redis)) {
         try {
             if ($this->redis->ping() === '+PONG') {
                 isset($this->lockKey) && $this->redis->delete($this->lockKey);
                 if (!$this->redis->close()) {
                     return FALSE;
                 }
             }
         } catch (\RedisException $e) {
             $this->logger->error('Session: Got RedisException on close(): ' . $e->getMessage());
         }
         $this->redis = NULL;
         return TRUE;
     }
     return TRUE;
 }
開發者ID:titounnes,項目名稱:CodeIgniter4,代碼行數:25,代碼來源:RedisHandler.php

示例13: close

 /**
  * Close
  *
  * Releases locks and closes connection.
  *
  * @return	bool
  */
 public function close()
 {
     if (isset($this->_redis)) {
         try {
             if ($this->_redis->ping() === '+PONG') {
                 isset($this->_lock_key) && $this->_redis->delete($this->_lock_key);
                 if (!$this->_redis->close()) {
                     return $this->_failure;
                 }
             }
         } catch (RedisException $e) {
             log_message('error', 'Session: Got RedisException on close(): ' . $e->getMessage());
         }
         $this->_redis = NULL;
         return $this->_success;
     }
     return $this->_success;
 }
開發者ID:wms-code,項目名稱:CodeIgniter-admin,代碼行數:25,代碼來源:Session_redis_driver.php

示例14: exec

 /**
  * Execute the request.
  */
 function exec()
 {
     $this->connect();
     switch ($this->method) {
         case 'GET':
             $this->get();
             break;
         case 'POST':
             $this->post();
             break;
         case 'PUT':
             $this->put();
             break;
         case 'DELETE':
             $this->delete();
             break;
     }
     $this->db->close();
 }
開發者ID:idaoya,項目名稱:php-rest-sql,代碼行數:22,代碼來源:phprestsql.php

示例15: close

 /**
  * 關閉數據庫連接
  *
  */
 function close()
 {
     if ($this->conn) {
         switch ($this->type) {
             case 'SQLite2':
                 sqlite_close($this->conn);
                 break;
             case 'SQLite3':
                 $this->conn->close();
                 break;
             case 'PDO':
                 break;
         }
     }
     $this->conn = null;
     $this->lasterr = null;
     $this->lasterrcode = null;
     $this->_transCount = 0;
     $this->_transCommit = true;
 }
開發者ID:jorkin,項目名稱:meiupic,代碼行數:24,代碼來源:sqlite.php


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