1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-05 05:37:39 +02:00

DibiMySqlDriver & MySQLi: sets time_zone in connect()

This commit is contained in:
David Grudl
2010-01-23 04:45:59 +01:00
parent 76c02a65da
commit 1ecc4ab134
3 changed files with 6 additions and 2 deletions

View File

@@ -22,7 +22,7 @@
*/
class DateTime53 extends DateTime
{
public function __sleep()
{
$this->fix = array($this->format('Y-m-d H:i:s'), $this->getTimezone()->getName());
@@ -50,5 +50,5 @@ class DateTime53 extends DateTime
{
return $this->__construct(date('Y-m-d H:i:s', $timestamp), new DateTimeZone($this->getTimezone()->getName())); // getTimeZone() crashes in PHP 5.2.6
}
}

View File

@@ -126,6 +126,8 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
$this->query("SET sql_mode='$config[sqlmode]'");
}
$this->query("SET time_zone='" . date('P') . "'");
$this->buffered = empty($config['unbuffered']);
}

View File

@@ -114,6 +114,8 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
$this->query("SET sql_mode='$config[sqlmode]'");
}
$this->query("SET time_zone='" . date('P') . "'");
$this->buffered = empty($config['unbuffered']);
}