Subversion Repositories PHPX

Rev

Rev 47 | Rev 52 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 47 Rev 51
Line 1... Line 1...
1
<?php
1
<?php
2
2
-
 
3
namespace PointedEars\PHPX\Db;
-
 
4
3
require_once __DIR__ . '/Database.php';
5
require_once __DIR__ . '/Database.php';
4
6
5
class MySQLDB extends Database
7
class MySQLDB extends Database
6
{
8
{
7
  /**
9
  /**
Line 47... Line 49...
47
  protected $_rightQuote = '`';
49
  protected $_rightQuote = '`';
48
50
49
  public function __construct()
51
  public function __construct()
50
  {
52
  {
51
        $this->readConfig();
53
        $this->readConfig();
52
       
54
53
    $this->_dsn = "mysql:host={$this->_host}"
55
    $this->_dsn = "mysql:host={$this->_host}"
54
      . (!is_null($this->_dbname) ? ";dbname={$this->_dbname}" : '')
56
      . (!is_null($this->_dbname) ? ";dbname={$this->_dbname}" : '')
55
      . (!is_null($this->_charset) ? ";charset={$this->_charset}" : '');
57
      . (!is_null($this->_charset) ? ";charset={$this->_charset}" : '');
56
58
57
    if (!is_null($this->_charset))
59
    if (!is_null($this->_charset))
58
    {
60
    {
59
      $this->_options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES " . $this->_charset;
61
      $this->_options[\PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES " . $this->_charset;
60
    }
62
    }
61
63
62
    parent::__construct();
64
    parent::__construct();
63
  }
65
  }
64
66