I would like to get the default MySQL database connection in Kohana for use with a third-party library. How can I do that?
So far I have the following code:
$db = Database::instance('default');
$db->connect(); // After this, how can I retrieve the MySQL connection instance?
The connection is stored in a protected property in the Database class.
You can see this variable in the Database class and where it’s being set in the MySQL class. If you wanted to have access to this variable then you can overload the Database class to provide a getter for it.