Disconnect from server.

@return $this
15817
public function disconnect() {
        if ($this->isConnected() && $this->connection !== false && is_integer($this->connection) === false) {
            $this->errors = array_merge($this->errors, imap_errors() ?: []);
            $this->connected = !imap_close($this->connection, IMAP::CL_EXPUNGE);
        }

        return $this;
    }
922459
public function disconnect() {
		$this->log->log("Disconnecting...",  XMPPHP_Log::LEVEL_VERBOSE);
		if(false == (bool) $this->socket) {
			return;
		}
		$this->reconnect = false;
		$this->send($this->stream_end);
		$this->sent_disconnect = true;
		$this->processUntil('end_stream', 5);
		$this->disconnected = true;
	}
249226
public function disconnect()
    {
        try {
            $this->doDisconnect();
        } catch (Throwable $e) {
            Log::channel('homer')->warning($e->getMessage(), [
                'exception' => $e
            ]);
        }
    }
443487
public function disconnect()
    {
        /* If we have an SMTP object, disconnect and destroy it. */
        if (is_object($this->_smtp) && $this->_smtp->disconnect()) {
            $this->_smtp = null;
        }

        /* We are disconnected if we no longer have an SMTP object. */
        return ($this->_smtp === null);
    }
499544
public function disconnect()
    {
        // if stateful connection, end the toolkit job.
        if (!$this->isStateless()) {
            $this->PgmCall("OFF", NULL);
        }

        // if transport is a db, end the db connection.
        if (isset($this->db) && $this->db) {
            $this->db->disconnect($this->conn);
        }

        $this->conn = null;
    }
248925
public function disconnect()
    {
        if (is_object($this->conn)) {
            $this->conn->disconnect();
            $this->conn = null;
        }
    }
541583
public function disconnect()
    {
        if ($this->pdo instanceof \PDO) {
            $this->pdo = null;

            $disconnected = true;
        } else {
            $disconnected = false;
        }

        return $disconnected;
    }
86945
public static function disconnect()
    {
        if (is_resource(self::$curl) && get_resource_type(self::$curl) == 'curl') {
            curl_close(self::$curl);
        }
        self::$curl = null;
    }
1178526
public function disconnect()
    {
        if (!$this->connected || !$this->server || ($this->mode ==  "mysql" && $this->server->connect_error)) {
            return false;
        }

        $result = false;

        switch ($this->mode) {

            case "mysql":
            case "sqlite":
                $result = $this->server->close();
                break;

            case "postgres":
            case "redshift":
                $result = pg_close($this->server);
                break;

            case "odbc":
                odbc_close($this->server);
                $result = true;
                break;

            case "mssql":
                $result = mssql_close($this->server);
                break;

            case "mssqlsrv":
                $result = sqlsrv_close($this->server);
                break;
        }

        # If the disconnect was successful, set class property to reflect it
        if ($result) {
            $this->connected = false;
        }

        return $result;
    }
1223005
private function __disconnect()
    {
        if (is_null($this->memcache)) {
            return;
        }
        $this->memcache->close();
        $this->memcache = null;

        return true;
    }
995468
public function disconnect()
	{    	
		$this->exec('echo "EXITING" && exit;');
		
		$this->_conn_link = NULL;
		$this->_connected = FALSE;
		$this->_sftp = NULL;
	}
291439
public function disconnect()
    {
        if ( $this->state != self::STATE_NOT_CONNECTED )
        {
            $this->connection->sendData( 'QUIT' );
            $this->connection->getLine(); // discard
            $this->state = self::STATE_UPDATE;

            $this->connection->close();
            $this->connection = null;
            $this->state = self::STATE_NOT_CONNECTED;
        }
    }
843843
public function disconnect()
    {
        if ($this->_connection) {
            try{
                $this->_connection->close();
            }catch(\Exception $e){
                
            }
            
        }

        $this->_db = $this->_connection = null;
    }
1324051
public function disconnect()
    {
        $streamResource = $this->getStreamResource();

        if (is_resource($streamResource)) {
            stream_socket_shutdown($streamResource, STREAM_SHUT_RDWR);
            $this->streamResource = null;
        }

        return $this;
    }
1179030
public function disconnect()
    {
        if ( $this->state !== self::STATE_NOT_CONNECTED
             && $this->connection->isConnected() === true )
        {
            $tag = $this->getNextTag();
            $this->connection->sendData( "{$tag} LOGOUT" );
            // discard the "bye bye" message ("{$tag} OK Logout completed.")
            $this->getResponse( $tag );
            $this->state = self::STATE_LOGOUT;
            $this->selectedMailbox = null;

            $this->connection->close();
            $this->connection = null;
            $this->state = self::STATE_NOT_CONNECTED;
        }
    }
554438
public function disconnect()
    {
        if (!is_resource($this->connection)) {
            $this->connected = false;

            return true;
        }
        $this->connected = !fclose($this->connection);

        if (!$this->connected) {
            $this->connection = null;
        }

        return !$this->connected;
    }
483305
public function actionDisconnect()
    {
        $providerHandle = craft()->request->getParam('provider');

        // reset token
        craft()->httpSession->remove('oauth.console.token.'.$providerHandle);

        // set notice
        craft()->userSession->setNotice(Craft::t("Disconnected."));

        // redirect
        $redirect = craft()->request->getUrlReferrer();
        $this->redirect($redirect);
    }