digitalpoint
Well-known member
While it's not hard to add with a custom adaptor that extends the normal one, I can think of some use cases beyond my own where you might want to disconnect from the db server, especially when you are using XF as a framework for other applications. For my case, I have something that reads some info from the database, does it's thing (which can take a few minutes) and then update the database once that is done. I'm disconnecting from the database, rather than hold the connection open (could be real problematic if you have multiple of these processes going on at once). Just extended the default adapter to give me a disconnect method:
PHP:
public function disconnect()
{
if ($this->isConnected())
{
$this->getConnection()->close();
$this->connection = null;
}
return true;
}
Upvote
9