Changeset 661 for trunk/lib


Ignore:
Timestamp:
Jan 30, 2019 11:14:22 PM (5 years ago)
Author:
anonymous
Message:

Remove cruft from timezone experiment

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r660 r661  
    16981698    public function setTimezone($tz)
    16991699    {
    1700         $this->setTimezone();
    17011700        // Set timezone for PHP.
    17021701        if (date_default_timezone_set($tz)) {
  • trunk/lib/DB.inc.php

    r660 r661  
    192192        $this->_connected = true;
    193193
    194         $init_sql = array();
    195 
    196194        // Tell MySQL what character set we're using. Available only on MySQL versions > 4.01.01.
    197195        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'))]));
    199197        } else {
    200198            $app->logMsg(sprintf('%s is not a known character_set.', $app->getParam('character_set')), LOG_ERR, __FILE__, __LINE__);
     
    209207        if ($this->getParam('timezone')) {
    210208            // 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')));
    217210        }
    218211
Note: See TracChangeset for help on using the changeset viewer.