Merge pull request #14877 from owncloud/smb-constructor-noconnect
Wait with getting the timezone from the smb server until we need itremotes/origin/etag-endpoint
commit
669ff45625
@ -1,2 +1,3 @@ |
|||||||
.idea |
.idea |
||||||
vendor |
vendor |
||||||
|
composer.lock |
||||||
|
@ -0,0 +1,35 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* Copyright (c) 2015 Robin Appelman <icewind@owncloud.com> |
||||||
|
* This file is licensed under the Licensed under the MIT license: |
||||||
|
* http://opensource.org/licenses/MIT |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace Icewind\SMB; |
||||||
|
|
||||||
|
class TimeZoneProvider { |
||||||
|
/** |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
private $host; |
||||||
|
|
||||||
|
/** |
||||||
|
* @var string |
||||||
|
*/ |
||||||
|
private $timeZone; |
||||||
|
|
||||||
|
/** |
||||||
|
* @param string $host |
||||||
|
*/ |
||||||
|
function __construct($host) { |
||||||
|
$this->host = $host; |
||||||
|
} |
||||||
|
|
||||||
|
public function get() { |
||||||
|
if (!$this->timeZone) { |
||||||
|
$command = 'net time zone -S ' . escapeshellarg($this->host); |
||||||
|
$this->timeZone = exec($command); |
||||||
|
} |
||||||
|
return $this->timeZone; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue