From 551e19dcc6da9c29aa5d0c2dc57c7f2c26d4351a Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Fri, 31 Jul 2015 16:50:10 +0200 Subject: [PATCH] Minor fixes in comments and phpdocs. --- lib/SimpleSAML/Database.php | 8 ++++---- .../Metadata/MetaDataStorageHandlerPdo.php | 12 ++++-------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/SimpleSAML/Database.php b/lib/SimpleSAML/Database.php index 28e88c142..e66288b2d 100644 --- a/lib/SimpleSAML/Database.php +++ b/lib/SimpleSAML/Database.php @@ -60,12 +60,12 @@ class Database $config = ($altConfig) ? $altConfig : \SimpleSAML_Configuration::getInstance(); $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])) { return self::$instance[$instanceId]; } - /* Create a new session. */ + // create a new session self::$instance[$instanceId] = new Database($config); return self::$instance[$instanceId]; } @@ -83,7 +83,7 @@ class Database $driverOptions = array(\PDO::ATTR_PERSISTENT => true); } - // Connect to the master + // connect to the master $this->dbMaster = $this->connect( $config->getString('database.dsn'), $config->getString('database.username', null), @@ -91,7 +91,7 @@ class Database $driverOptions ); - // Connect to any configured slaves + // connect to any configured slaves $slaves = $config->getArray('database.slaves', array()); if (count($slaves >= 1)) { foreach ($slaves as $slave) { diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php index 600eea8ee..dc08e5cc4 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerPdo.php @@ -51,22 +51,18 @@ class SimpleSAML_Metadata_MetaDataStorageHandlerPdo extends SimpleSAML_Metadata_ * This constructor initializes the PDO metadata storage handler with the specified * configuration. The configuration is an associative array with the following * possible elements (set in config.php): - * - 'usePersistentConnection': TRUE/FALSE if database connection should be - * persistent. - * - * - 'dsn': The database connection string. - * + * - 'usePersistentConnection': TRUE/FALSE if database connection should be persistent. + * - 'dsn': The database connection string. * - 'username': Database user name - * * - '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) { assert('is_array($config)'); - $this->db = SimpleSAML\Database::getInstance(); + $this->db = SimpleSAML\Database::getInstance($config); } -- GitLab