|
ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Collaboration diagram for SimpleSAML\Database:Public Member Functions | |
| applyPrefix ($table) | |
| This function simply applies the table prefix to a supplied table name. More... | |
| write ($stmt, $params=array()) | |
| This executes queries directly on the master. More... | |
| read ($stmt, $params=array()) | |
| This executes queries on a database server that is determined by this::getSlave(). More... | |
| getLastError () | |
| Return an array with information about the last operation performed in the database. More... | |
Static Public Member Functions | |
| static | getInstance ($altConfig=null) |
| Retrieves the current database instance. More... | |
Private Member Functions | |
| __construct ($config) | |
| Private constructor that restricts instantiation to getInstance(). More... | |
| connect ($dsn, $username, $password, $options) | |
| This function connects to a database. More... | |
| getSlave () | |
| This function randomly selects a slave database server to query. More... | |
| query ($db, $stmt, $params) | |
| This function queries the database. More... | |
| exec ($db, $stmt) | |
| This function queries the database without using a prepared statement. More... | |
Static Private Member Functions | |
| static | generateInstanceId ($config) |
| Generate an Instance ID based on the database configuration. More... | |
Private Attributes | |
| $dbMaster | |
| PDO Object for the Master database server. More... | |
| $dbSlaves = array() | |
| Array of PDO Objects for configured database slaves. More... | |
| $tablePrefix | |
| Prefix to apply to the tables. More... | |
| $lastError | |
| Array with information on the last error occurred. More... | |
Static Private Attributes | |
| static | $instance = array() |
| This variable holds the instance of the session - Singleton approach. More... | |
Definition at line 19 of file Database.php.
|
private |
Private constructor that restricts instantiation to getInstance().
| \SimpleSAML_Configuration | $config | Instance of the SimpleSAML_Configuration class |
Definition at line 76 of file Database.php.
References $config.
| SimpleSAML\Database::applyPrefix | ( | $table | ) |
This function simply applies the table prefix to a supplied table name.
| string | $table | Table to apply prefix to, if configured |
Definition at line 181 of file Database.php.
|
private |
This function connects to a database.
| string | $dsn | Database connection string |
| string | $username | SQL user |
| string | $password | SQL password |
| array | $options | PDO options |
Exception If an error happens while trying to connect to the database.
Definition at line 144 of file Database.php.
References $dsn, PHPMailer\PHPMailer\$options, and $password.
|
private |
This function queries the database without using a prepared statement.
| \PDO | $db | PDO object to use |
| string | $stmt | An SQL statement to execute, previously escaped. |
Exception If an error happens while trying to execute the query.
Definition at line 233 of file Database.php.
References $stmt.
|
staticprivate |
Generate an Instance ID based on the database configuration.
| \SimpleSAML_Configuration | $config | Configuration class |
Definition at line 116 of file Database.php.
References $config.
|
static |
Retrieves the current database instance.
Will create a new one if there isn't an existing connection.
| \SimpleSAML_Configuration | $altConfig | Optional: Instance of a SimpleSAML_Configuration class |
Definition at line 55 of file Database.php.
References $config, and SimpleSAML_Configuration\getInstance().
Referenced by SimpleSAML_Metadata_MetaDataStorageHandlerPdo\__construct().
Here is the call graph for this function:
Here is the caller graph for this function:| SimpleSAML\Database::getLastError | ( | ) |
Return an array with information about the last operation performed in the database.
Definition at line 289 of file Database.php.
|
private |
This function randomly selects a slave database server to query.
In the event no slaves are configured, it will return the master.
Definition at line 163 of file Database.php.
|
private |
This function queries the database.
| \PDO | $db | PDO object to use |
| string | $stmt | Prepared SQL statement |
| array | $params | Parameters |
Exception If an error happens while trying to execute the query.
Definition at line 197 of file Database.php.
References PHPMailer\PHPMailer\$params, $query, and $stmt.
| SimpleSAML\Database::read | ( | $stmt, | |
$params = array() |
|||
| ) |
This executes queries on a database server that is determined by this::getSlave().
| string | $stmt | Prepared SQL statement |
| array | $params | Parameters |
Definition at line 276 of file Database.php.
References PHPMailer\PHPMailer\$params, and $stmt.
| SimpleSAML\Database::write | ( | $stmt, | |
$params = array() |
|||
| ) |
This executes queries directly on the master.
| string | $stmt | Prepared SQL statement |
| array | $params | Parameters |
Definition at line 255 of file Database.php.
References PHPMailer\PHPMailer\$params, and $stmt.
|
private |
PDO Object for the Master database server.
Definition at line 30 of file Database.php.
|
private |
Array of PDO Objects for configured database slaves.
Definition at line 35 of file Database.php.
|
staticprivate |
This variable holds the instance of the session - Singleton approach.
Definition at line 25 of file Database.php.
|
private |
Array with information on the last error occurred.
Definition at line 45 of file Database.php.
|
private |
Prefix to apply to the tables.
Definition at line 40 of file Database.php.