9,53 → 9,54 |
* @var string |
*/ |
protected $_host; |
|
|
/** |
* Database name |
* @var string |
*/ |
protected $_dbname; |
|
|
/** |
* Username to access the database |
* @var string |
*/ |
protected $_username; |
|
|
/** |
* Password to access the database |
* @var string |
*/ |
protected $_password; |
|
/* |
|
/** |
* Optional charset parameter value |
* @var string |
*/ |
protected $_charset = null; |
|
|
/** |
* (non-PHPdoc) |
* @see Database::_leftQuote |
*/ |
protected $_leftQuote = '`'; |
|
|
/** |
* (non-PHPdoc) |
* @see Database::_rightQuote |
*/ |
protected $_rightQuote = '`'; |
|
|
public function __construct() |
{ |
$this->_dsn = "mysql:host={$this->_host}" |
. (!is_null($this->_dbname) ? ";dbname={$this->_dbname}" : '') |
. (!is_null($this->_charset) ? ";charset={$this->_charset}" : ''); |
|
|
if (!is_null($this->_charset)) |
{ |
$this->_options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES " . $this->_charset; |
} |
|
|
parent::__construct(); |
} |
} |