Skip to content
Snippets Groups Projects
Commit 057526fd authored by Elijah Lynn's avatar Elijah Lynn
Browse files

Make SQL options optional in examples.

parent 8e7d5ff1
No related branches found
No related tags found
No related merge requests found
...@@ -273,9 +273,11 @@ The class follows: ...@@ -273,9 +273,11 @@ The class follows:
throw new Exception('Missing or invalid password option in config.'); throw new Exception('Missing or invalid password option in config.');
} }
$this->password = $config['password']; $this->password = $config['password'];
$this->options = $config['options']; if (isset($config['options']) {
if (!is_array($config['options])) { if (!is_array($config['options])) {
throw new Exception('Missing or invalid options option in config.'); throw new Exception('Missing or invalid options option in config.');
}
$this->options = $config['options'];
} }
} }
......
...@@ -485,7 +485,7 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store ...@@ -485,7 +485,7 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
$driver_options[PDO::ATTR_TIMEOUT] = $this->_timeout; $driver_options[PDO::ATTR_TIMEOUT] = $this->_timeout;
} }
if (isset($this->_options)) { if (isset($this->_options)) {
array_merge($driver_options, $this->_options); $this->_options = array_merge($driver_options, $this->_options);
} else { } else {
$this->_options = $driver_options; $this->_options = $driver_options;
} }
......
...@@ -74,8 +74,10 @@ class sspmod_sqlauth_Auth_Source_SQL extends sspmod_core_Auth_UserPassBase { ...@@ -74,8 +74,10 @@ class sspmod_sqlauth_Auth_Source_SQL extends sspmod_core_Auth_UserPassBase {
$this->dsn = $config['dsn']; $this->dsn = $config['dsn'];
$this->username = $config['username']; $this->username = $config['username'];
$this->password = $config['password']; $this->password = $config['password'];
$this->options = $config['options'];
$this->query = $config['query']; $this->query = $config['query'];
if (isset($config['options'])) {
$this->options = $config['options'];
}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment