diff --git a/sys/db/dbreg.php b/sys/db/dbreg.php index 6799774..7e46b1c 100644 --- a/sys/db/dbreg.php +++ b/sys/db/dbreg.php @@ -7,14 +7,14 @@ * @author Timothy J. Warren * @copyright Copyright (c) 2012 * @link https://github.com/aviat4ion/OpenSQLManager - * @license http://philsturgeon.co.uk/code/dbad-license + * @license http://philsturgeon.co.uk/code/dbad-license */ // -------------------------------------------------------------------------- /** * Connection registry - * + * * Decouples the Settings class from the query builder * and organizes database connections */ @@ -24,7 +24,7 @@ class DB_Reg { /** * Registry access method - * + * * @param string $key * @return object */ @@ -43,9 +43,10 @@ class DB_Reg { /** * Private constructor + * * @param string $key */ - protected function __construct($key) + private function __construct($key) { // Get the db connection parameters for the current database $db_params = Settings::get_instance()->get_db($key); @@ -53,4 +54,17 @@ class DB_Reg { // Set the current key in the registry self::$instance[$key] = new Query_Builder($db_params); } -} \ No newline at end of file + + // -------------------------------------------------------------------------- + + /** + * Return exiting connections + * + * @return array + */ + public function get_connections() + { + return array_keys(self::$instance); + } +} +// End of dbreg.php \ No newline at end of file