Changeset b4b5ba7 in github for program/include/rcube_mdb2.php
- Timestamp:
- May 26, 2012 9:28:44 AM (12 months ago)
- Branches:
- master, HEAD, dev-browser-capabilities, pdo
- Children:
- 3720282
- Parents:
- fa5f3f2
- File:
-
- 1 edited
-
program/include/rcube_mdb2.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_mdb2.php
r041c93c rb4b5ba7 49 49 private $last_res_id = 0; 50 50 private $tables; 51 private $variables; 51 52 52 53 … … 211 212 { 212 213 return !empty($this->db_dsnr) && $this->db_dsnw != $this->db_dsnr; 214 } 215 216 217 /** 218 * Get database runtime variables 219 * 220 * @param string Variable name 221 * @param mixed Default value if var is not set 222 * @return mixed Variable value or default 223 */ 224 public function get_variable($varname, $default = null) 225 { 226 if (!isset($this->variables)) { 227 $this->variables = array(); 228 229 // only mysql and postgres are know to support this 230 if ($this->db_provider == 'pgsql' || $this->db_provider == 'mysql' || $this->db_provider == 'mysqli') { 231 $this->db_connect('r'); 232 $query = $this->db_provider == 'pgsql' ? 'SHOW ALL' : 'SHOW VARIABLES'; 233 foreach ((array)$this->db_handle->queryAll($query) as $row) 234 $this->variables[$row[0]] = $row[1]; 235 } 236 } 237 238 return isset($this->variables[$varname]) ? $this->variables[$varname] : $default; 213 239 } 214 240
Note: See TracChangeset
for help on using the changeset viewer.
