- Timestamp:
- Jan 30, 2019 11:14:22 PM (5 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r660 r661 1698 1698 public function setTimezone($tz) 1699 1699 { 1700 $this->setTimezone();1701 1700 // Set timezone for PHP. 1702 1701 if (date_default_timezone_set($tz)) { -
trunk/lib/DB.inc.php
r660 r661 192 192 $this->_connected = true; 193 193 194 $init_sql = array();195 196 194 // Tell MySQL what character set we're using. Available only on MySQL versions > 4.01.01. 197 195 if ('' != $app->getParam('character_set') && isset($this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))])) { 198 $ init_sql[] = sprintf("SET NAMES '%s'", $this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))]);196 $this->query(sprintf("SET NAMES '%s';", $this->mysql_character_sets[mb_strtolower($app->getParam('character_set'))])); 199 197 } else { 200 198 $app->logMsg(sprintf('%s is not a known character_set.', $app->getParam('character_set')), LOG_ERR, __FILE__, __LINE__); … … 209 207 if ($this->getParam('timezone')) { 210 208 // https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html 211 $init_sql[] = sprintf("SET time_zone = '%s'", $this->getParam('timezone')); 212 } 213 214 // Run init query, if set. 215 if (!empty($init_sql)) { 216 $this->query(join('; ', $init_sql)); 209 $this->query(sprintf("SET time_zone = '%s';", $this->getParam('timezone'))); 217 210 } 218 211
Note: See TracChangeset
for help on using the changeset viewer.