DbReg class improvements
This commit is contained in:
parent
1ea1896378
commit
e7abfec149
@ -43,9 +43,10 @@ class DB_Reg {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor
|
* Private constructor
|
||||||
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
*/
|
*/
|
||||||
protected function __construct($key)
|
private function __construct($key)
|
||||||
{
|
{
|
||||||
// Get the db connection parameters for the current database
|
// Get the db connection parameters for the current database
|
||||||
$db_params = Settings::get_instance()->get_db($key);
|
$db_params = Settings::get_instance()->get_db($key);
|
||||||
@ -53,4 +54,17 @@ class DB_Reg {
|
|||||||
// Set the current key in the registry
|
// Set the current key in the registry
|
||||||
self::$instance[$key] = new Query_Builder($db_params);
|
self::$instance[$key] = new Query_Builder($db_params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return exiting connections
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function get_connections()
|
||||||
|
{
|
||||||
|
return array_keys(self::$instance);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// End of dbreg.php
|
Loading…
Reference in New Issue
Block a user