Skip to content
Snippets Groups Projects
Commit 551e19dc authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Minor fixes in comments and phpdocs.

parent b63c5c71
Branches
Tags
No related merge requests found
...@@ -60,12 +60,12 @@ class Database ...@@ -60,12 +60,12 @@ class Database
$config = ($altConfig) ? $altConfig : \SimpleSAML_Configuration::getInstance(); $config = ($altConfig) ? $altConfig : \SimpleSAML_Configuration::getInstance();
$instanceId = self::generateInstanceId($config); $instanceId = self::generateInstanceId($config);
/* Check if we already have initialized the session. */ // check if we already have initialized the session
if (isset(self::$instance[$instanceId])) { if (isset(self::$instance[$instanceId])) {
return self::$instance[$instanceId]; return self::$instance[$instanceId];
} }
/* Create a new session. */ // create a new session
self::$instance[$instanceId] = new Database($config); self::$instance[$instanceId] = new Database($config);
return self::$instance[$instanceId]; return self::$instance[$instanceId];
} }
...@@ -83,7 +83,7 @@ class Database ...@@ -83,7 +83,7 @@ class Database
$driverOptions = array(\PDO::ATTR_PERSISTENT => true); $driverOptions = array(\PDO::ATTR_PERSISTENT => true);
} }
// Connect to the master // connect to the master
$this->dbMaster = $this->connect( $this->dbMaster = $this->connect(
$config->getString('database.dsn'), $config->getString('database.dsn'),
$config->getString('database.username', null), $config->getString('database.username', null),
...@@ -91,7 +91,7 @@ class Database ...@@ -91,7 +91,7 @@ class Database
$driverOptions $driverOptions
); );
// Connect to any configured slaves // connect to any configured slaves
$slaves = $config->getArray('database.slaves', array()); $slaves = $config->getArray('database.slaves', array());
if (count($slaves >= 1)) { if (count($slaves >= 1)) {
foreach ($slaves as $slave) { foreach ($slaves as $slave) {
......
...@@ -51,22 +51,18 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ ...@@ -51,22 +51,18 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_
* This constructor initializes the PDO metadata storage handler with the specified * This constructor initializes the PDO metadata storage handler with the specified
* configuration. The configuration is an associative array with the following * configuration. The configuration is an associative array with the following
* possible elements (set in config.php): * possible elements (set in config.php):
* - 'usePersistentConnection': TRUE/FALSE if database connection should be * - 'usePersistentConnection': TRUE/FALSE if database connection should be persistent.
* persistent. * - 'dsn': The database connection string.
*
* - 'dsn': The database connection string.
*
* - 'username': Database user name * - 'username': Database user name
*
* - 'password': Password for the database user. * - 'password': Password for the database user.
* *
* @param array $config An associtive array with the configuration for this handler. * @param array $config An associative array with the configuration for this handler.
*/ */
public function __construct($config) public function __construct($config)
{ {
assert('is_array($config)'); assert('is_array($config)');
$this->db = SimpleSAML\Database::getInstance(); $this->db = SimpleSAML\Database::getInstance($config);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment