mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-04 01:34:07 +02:00
Wait with getting the timezone from the server until we need it
This commit is contained in:
parent
ededbfbaa3
commit
476980d4ce
5 changed files with 72 additions and 15 deletions
|
|
@ -17,15 +17,15 @@ use Icewind\SMB\Exception\NotFoundException;
|
|||
|
||||
class Parser {
|
||||
/**
|
||||
* @var string
|
||||
* @var \Icewind\SMB\TimeZoneProvider
|
||||
*/
|
||||
protected $timeZone;
|
||||
protected $timeZoneProvider;
|
||||
|
||||
/**
|
||||
* @param string $timeZone
|
||||
* @param \Icewind\SMB\TimeZoneProvider $timeZoneProvider
|
||||
*/
|
||||
public function __construct($timeZone) {
|
||||
$this->timeZone = $timeZone;
|
||||
public function __construct(TimeZoneProvider $timeZoneProvider) {
|
||||
$this->timeZoneProvider = $timeZoneProvider;
|
||||
}
|
||||
|
||||
public function checkForError($output, $path) {
|
||||
|
|
@ -120,7 +120,7 @@ class Parser {
|
|||
list(, $name, $mode, $size, $time) = $matches;
|
||||
if ($name !== '.' and $name !== '..') {
|
||||
$mode = $this->parseMode($mode);
|
||||
$time = strtotime($time . ' ' . $this->timeZone);
|
||||
$time = strtotime($time . ' ' . $this->timeZoneProvider->get());
|
||||
$content[] = new FileInfo($basePath . '/' . $name, $name, $size, $time, $mode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue