| @@ 79-95 (lines=17) @@ | ||
| 76 | * @param array $params |
|
| 77 | * @return void |
|
| 78 | */ |
|
| 79 | public function __construct($params) |
|
| 80 | { |
|
| 81 | parent::__construct($params); |
|
| 82 | ||
| 83 | if (empty($this->dsn)) |
|
| 84 | { |
|
| 85 | $this->dsn = '4D:host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); |
|
| 86 | ||
| 87 | empty($this->port) OR $this->dsn .= ';port='.$this->port; |
|
| 88 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
|
| 89 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
|
| 90 | } |
|
| 91 | elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 3) === FALSE) |
|
| 92 | { |
|
| 93 | $this->dsn .= ';charset='.$this->char_set; |
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||
| 97 | // -------------------------------------------------------------------- |
|
| 98 | ||
| @@ 97-113 (lines=17) @@ | ||
| 94 | * @param array $params |
|
| 95 | * @return void |
|
| 96 | */ |
|
| 97 | public function __construct($params) |
|
| 98 | { |
|
| 99 | parent::__construct($params); |
|
| 100 | ||
| 101 | if (empty($this->dsn)) |
|
| 102 | { |
|
| 103 | $this->dsn = 'mysql:host='.(empty($this->hostname) ? '127.0.0.1' : $this->hostname); |
|
| 104 | ||
| 105 | empty($this->port) OR $this->dsn .= ';port='.$this->port; |
|
| 106 | empty($this->database) OR $this->dsn .= ';dbname='.$this->database; |
|
| 107 | empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set; |
|
| 108 | } |
|
| 109 | elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE && is_php('5.3.6')) |
|
| 110 | { |
|
| 111 | $this->dsn .= ';charset='.$this->char_set; |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | // -------------------------------------------------------------------- |
|
| 116 | ||