DbConnection: Rename getTimezoneOffset() to defaultTimezoneOffset()

refs Icinga/icingaweb2-module-director#1837
This commit is contained in:
Johannes Meyer 2019-04-17 12:28:54 +02:00
parent f72aa291bc
commit 4d0a9fb289

View File

@ -207,7 +207,7 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
$driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', NAMES ' . $adapterParamaters['charset']; $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', NAMES ' . $adapterParamaters['charset'];
unset($adapterParamaters['charset']); unset($adapterParamaters['charset']);
} }
$driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= ', time_zone=\'' . $this->getTimezoneOffset() . '\''; $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .= ", time_zone='" . $this->defaultTimezoneOffset() . "'";
$driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .=';'; $driverOptions[PDO::MYSQL_ATTR_INIT_COMMAND] .=';';
$defaultPort = 3306; $defaultPort = 3306;
break; break;
@ -295,7 +295,7 @@ class DbConnection implements Selectable, Extensible, Updatable, Reducible, Insp
* *
* @return string * @return string
*/ */
public function getTimezoneOffset() protected function defaultTimezoneOffset()
{ {
$tz = new DateTimeZone(date_default_timezone_get()); $tz = new DateTimeZone(date_default_timezone_get());
$offset = $tz->getOffset(new DateTime()); $offset = $tz->getOffset(new DateTime());