| Conditions | 6 |
| Paths | 4 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function get($host) { |
||
| 29 | if (!isset($this->timeZones[$host])) { |
||
| 30 | $net = $this->system->getNetPath(); |
||
| 31 | // for local domain names we can assume same timezone |
||
| 32 | if ($net && $host && strpos($host, '.') !== false) { |
||
| 33 | $command = sprintf('%s time zone -S %s', |
||
| 34 | $net, |
||
| 35 | escapeshellarg($host) |
||
| 36 | ); |
||
| 37 | $timeZone = exec($command); |
||
| 38 | if (!$timeZone) { |
||
| 39 | $timeZone = date_default_timezone_get(); |
||
| 40 | } |
||
| 41 | $this->timeZones[$host] = $timeZone; |
||
| 42 | } else { // fallback to server timezone |
||
| 43 | $this->timeZones[$host] = date_default_timezone_get(); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | return $this->timeZones[$host]; |
||
| 47 | } |
||
| 48 | } |
||
| 49 |