Class for manipulating datbase connections, and miscellaneous settings

package OpenSQLManager
subpackage Common

 Methods

Output the settings on destruct

__destruct() 

Magic method to simplify isset checking for config options

__get(string $key) : mixed

Parameters

$key

string

Returns

mixed

Magic method to simplify setting config options

__set(string $key, $val) 

Parameters

$key

string

$val

mixed

Add a database connection

add_db(string $name, array $params) 

Parameters

$name

string

$params

array

Edit a database connection

edit_db(string $name, array $params) 

Parameters

$name

string

$params

array

Retreive a specific database connection

get_db(string $name) : object

Parameters

$name

string

Returns

object

Retreive all db connections

get_dbs() : array

Returns

array

Static method to retreive current instance of the singleton

get_instance() : \OpenSQLManager\Settings

Remove a database connection

remove_db(string $name) 

Parameters

$name

string

Load the settings file - private so it can't be loaded directly - the settings should be safe!

__construct() 

 Properties

 

Settings object represented by the currently loaded JSON file

$current 

 

Singleton instance

$instance