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