Skip to content
Permalink
Browse files

Added __debugInfo() to Connection

  • Loading branch information...
robertpustulka committed Sep 8, 2014
1 parent 84ecb65 commit ceb11c4ac272320bb8ad5ba86ac8aa0587b33f57
Showing with 30 additions and 0 deletions.
  1. +30 −0 src/Database/Connection.php
@@ -629,4 +629,34 @@ protected function _newLogger(StatementInterface $statement) {
return $log;
}
/**
* Returns an array that can be used to describe the internal state of this
* object.
*
* @return array
*/
public function __debugInfo() {
$secrets = [
'password' => '*****',
'login' => '*****',
'host' => '*****',
'database' => '*****',
'port' => '*****',
'prefix' => '*****',
'schema' => '*****'
];
$replace = array_intersect_key($secrets, $this->_config);
$config = $replace + $this->_config;
return [
'_config' => $config,
'_driver' => $this->_driver,
'_transactionLevel' => $this->_transactionLevel,
'_transactionStarted' => $this->_transactionStarted,
'_useSavePoints' => $this->_useSavePoints,
'_logQueries' => $this->_logQueries,
'_logger' => $this->_logger
];
}
}

0 comments on commit ceb11c4

Please sign in to comment.
You can’t perform that action at this time.