Skip to content

Commit

Permalink
Added __debugInfo() to Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpustulka committed Sep 8, 2014
1 parent 84ecb65 commit ceb11c4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Database/Connection.php
Expand Up @@ -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.