Conform to code style guidelines

refs #11115
This commit is contained in:
Alexander A. Klimov 2016-12-08 17:09:00 +01:00
parent dce6b4eb08
commit 0bafc944d3
2 changed files with 10 additions and 10 deletions

View File

@ -517,14 +517,14 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
'IN (\'version\', \'protocol_version\', \'version_compile_os\', \'have_ssl\');' 'IN (\'version\', \'protocol_version\', \'version_compile_os\', \'have_ssl\');'
)->fetchAll(); )->fetchAll();
$sqlinsp = new Inspection('MySQL'); $sqlinsp = new Inspection('MySQL');
$have_ssl = false; $hasSsl = false;
foreach ($rows as $row) { foreach ($rows as $row) {
$sqlinsp->write($row->variable_name . ': ' . $row->value); $sqlinsp->write($row->variable_name . ': ' . $row->value);
if ($row->variable_name === 'have_ssl' && $row->value === 'YES') { if ($row->variable_name === 'have_ssl' && $row->value === 'YES') {
$have_ssl = true; $hasSsl = true;
} }
} }
if ($have_ssl) { if ($hasSsl) {
$ssl_rows = $this->dbAdapter->query( $ssl_rows = $this->dbAdapter->query(
'SHOW STATUS WHERE variable_name ' . 'SHOW STATUS WHERE variable_name ' .
'IN (\'Ssl_Cipher\');' 'IN (\'Ssl_Cipher\');'

View File

@ -305,7 +305,7 @@ class DbTool
return; return;
} }
$driver_options = array( $driverOptions = array(
PDO::ATTR_TIMEOUT => 1, PDO::ATTR_TIMEOUT => 1,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
); );
@ -317,19 +317,19 @@ class DbTool
) { ) {
# The presence of these keys as empty strings or null cause non-ssl connections to fail # The presence of these keys as empty strings or null cause non-ssl connections to fail
if ($this->config['ssl_key']) { if ($this->config['ssl_key']) {
$driver_options[PDO::MYSQL_ATTR_SSL_KEY] = $this->config['ssl_key']; $driverOptions[PDO::MYSQL_ATTR_SSL_KEY] = $this->config['ssl_key'];
} }
if ($this->config['ssl_cert']) { if ($this->config['ssl_cert']) {
$driver_options[PDO::MYSQL_ATTR_SSL_CERT] = $this->config['ssl_cert']; $driverOptions[PDO::MYSQL_ATTR_SSL_CERT] = $this->config['ssl_cert'];
} }
if ($this->config['ssl_ca']) { if ($this->config['ssl_ca']) {
$driver_options[PDO::MYSQL_ATTR_SSL_CA] = $this->config['ssl_ca']; $driverOptions[PDO::MYSQL_ATTR_SSL_CA] = $this->config['ssl_ca'];
} }
if ($this->config['ssl_capath']) { if ($this->config['ssl_capath']) {
$driver_options[PDO::MYSQL_ATTR_SSL_CAPATH] = $this->config['ssl_capath']; $driverOptions[PDO::MYSQL_ATTR_SSL_CAPATH] = $this->config['ssl_capath'];
} }
if ($this->config['ssl_cipher']) { if ($this->config['ssl_cipher']) {
$driver_options[PDO::MYSQL_ATTR_SSL_CIPHER] = $this->config['ssl_cipher']; $driverOptions[PDO::MYSQL_ATTR_SSL_CIPHER] = $this->config['ssl_cipher'];
} }
} }
@ -337,7 +337,7 @@ class DbTool
$this->buildDsn($this->config['db'], $dbname), $this->buildDsn($this->config['db'], $dbname),
$this->config['username'], $this->config['username'],
$this->config['password'], $this->config['password'],
$driver_options $driverOptions
); );
} }