/** * Closes the FTP connection * * @return boolean */ function disconnect() { if ($this->archive) { $this->archive->close(); $this->archive = null; } return true; }
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(); }
/** * Destroy this cell collection */ public function __destruct() { if (!is_null($this->_DBHandle)) { $this->_DBHandle->close(); } $this->_DBHandle = null; }
/** * 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; }
/** * 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(); } }
/** * Disconnects this connection * @return null */ public function disconnect() { if (!$this->isConnected()) { return; } $this->connection->close(); $this->connection = null; }
/** * 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; }
/** * 从服务端接收数据 * @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); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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(); }
/** * 关闭数据库连接 * */ 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; }
/** * Execute the request. */ function exec() { //var_dump($this->table); $this->output['log'] = "#----Exec Start----.\n"; if ($this->table == '') { $this->output['log'] .= "No Parameters.\n"; $this->controller_function = 'home_index'; $this->go(); exit; } elseif (in_array($this->table, $this->public_methods)) { $this->output['log'] .= "Public Method Called:" . $this->table . ".\n"; $this->controller_function = $this->table; $this->connect(); $this->go(); } elseif (in_array($this->table, $this->internal_methods)) { // Time to check basic permissions // Currently everything that gets here requires login $this->output['log'] .= "Authentication Required.\n"; $this->connect(); $this->require_login(); } // //$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(); //var_dump($_SESSION); }
function __destruct() { if ($this->_conn !== FALSE) { $this->_conn->close(); } }
/** * @return bool */ public function close() { $result = TRUE; if ($this->connected && !$this->persistent) { try { $result = $this->standalone ? fclose($this->redis) : $this->redis->close(); $this->connected = FALSE; } catch (Exception $e) { // Ignore exceptions on close } } return $result; }
/** * Destructor * * @return void */ public function __destruct() { if (is_resource($this->_socket)) { $this->_socket->close(); } }
/** * @return bool */ public function close() { $result = TRUE; if ($this->connected) { if ($this->standalone) { $result = fclose($this->redis); } else { $result = $this->redis->close(); } $this->connected = FALSE; } return $result; }
/** * Close the SessionHandler backend. * * @access public * @return boolean True on success, false otherwise. */ function close() { return $this->_db->close(); }
/** * Frees memory associated with the underlying XML parser. * * Note that only the memory associated with the underlying XML parser is * freed. Memory associated with the class itself is not freed. * */ public function close() { $this->reader->close(); }
/** * Close MySQL connection * * @return void * @deprecated since version 2.6.0 - alpha 3. Switch to doctrine connector. */ public function close() { $this->deprecated(); return $this->conn->close(); }
/** * Closes the memcache based session storage handler * * @access protected */ protected function _close() { return $this->_conn->close(); }
/** * Close the session * @return bool */ public function close() { return $this->dbConnection->close(); }
/** * @return bool */ public function close() { $result = TRUE; if ($this->connected) { if ($this->standalone) { $result = fclose($this->redis); } else { try { $result = $this->redis->close(); } catch (Exception $e) { //Hack because for some reason an exception is thrown here on a regular basis } } $this->connected = FALSE; } return $result; }
public function __destruct() { $this->connection->close(); }
/** * 关闭连接 * * @return void */ public function close() { if (!is_null($this->mysql)) { $this->mysql->close(); } }