Skip to content

Commit

Permalink
Follow up to 4b9ad73, make Database::__construct not final, and set t…
Browse files Browse the repository at this point in the history
…he identifier in Database_PDO::__construct
  • Loading branch information
Woody Gilk committed Jun 11, 2010
1 parent 8e79869 commit f52e71f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion classes/kohana/database.php
Expand Up @@ -99,7 +99,7 @@ public static function instance($name = NULL, array $config = NULL)
*
* @return void
*/
final protected function __construct($name, array $config)
protected function __construct($name, array $config)
{
// Set the instance name
$this->_instance = $name;
Expand Down
17 changes: 11 additions & 6 deletions classes/kohana/database/pdo.php
Expand Up @@ -13,6 +13,17 @@ class Kohana_Database_PDO extends Database {
// PDO uses no quoting for identifiers
protected $_identifier = '';

protected function __construct($name, array $config)
{
parent::__construct($name, $config);

if (isset($this->_config['identifier']))
{
// Allow the identifier to be overloaded per-connection
$this->_identifier = (string) $this->_config['identifier'];
}
}

public function connect()
{
if ($this->_connection)
Expand Down Expand Up @@ -41,12 +52,6 @@ public function connect()
// Create a new PDO connection
$this->_connection = new PDO($dsn, $username, $password, $attrs);

if (isset($this->_config['identifier']))
{
// Allow the identifier to be overloaded per-connection
$this->_identifier = (string) $this->_config['identifier'];
}

if ( ! empty($this->_config['charset']))
{
// Set the character set
Expand Down

0 comments on commit f52e71f

Please sign in to comment.