fix timezone injection

This commit is contained in:
Robin Appelman 2018-07-13 12:49:28 +02:00
commit fc9963f738

View file

@ -60,10 +60,11 @@ class ServerFactory {
$system = new System(); $system = new System();
} }
if (is_null($timeZoneProvider)) { if (is_null($timeZoneProvider)) {
$system = new TimeZoneProvider($system); $timeZoneProvider = new TimeZoneProvider($system);
} }
$this->options = $options; $this->options = $options;
$this->system = $system; $this->system = $system;
$this->timeZoneProvider = $timeZoneProvider;
} }
@ -76,7 +77,7 @@ class ServerFactory {
public function createServer($host, IAuth $credentials) { public function createServer($host, IAuth $credentials) {
foreach (self::BACKENDS as $backend) { foreach (self::BACKENDS as $backend) {
if (call_user_func("$backend::available", $this->system)) { if (call_user_func("$backend::available", $this->system)) {
return new $backend($host, $credentials, $this->system, $this->timeZoneProvider); return new $backend($host, $credentials, $this->system, $this->timeZoneProvider, $this->options);
} }
} }