I'm using the Joomla Database Framework package for an internal project.
To initiate a Database instance, I'm using the following:
$db = Joomla\Database\DatabaseDriver::getInstance($options);
$options variable would look something like this:
$options = array( 'host' => 'localhost', 'user' => 'XXXXX', 'password' => 'XXXXXXX', 'database' => 'XXXXX', );
Any function that has a database query will require the
getInstance which is perfect fine, however I do not wish to define the
$options in every single function.
How would I overcome this?
Would it be better to create a wrapper class/function and call that instead?