Skip to content

Commit

Permalink
set timezone for smbclient and parser to UTC
Browse files Browse the repository at this point in the history
  • Loading branch information
icewind1991 committed May 30, 2022
1 parent 3e25d31 commit 76995aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Wrapped/RawConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function connect(): void {
'CLI_NO_READLINE' => 1, // Not all distros build smbclient with readline, disable it to get consistent behaviour
'LC_ALL' => Server::LOCALE,
'LANG' => Server::LOCALE,
'COLUMNS' => 8192 // prevent smbclient from line-wrapping it's output
'COLUMNS' => 8192, // prevent smbclient from line-wrapping it's output
'TZ' => 'UTC',
]);
$this->process = proc_open($this->command, $descriptorSpec, $this->pipes, '/', $env);
if (!$this->isValid()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Wrapped/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function listShares(): array {
throw new ConnectionException((string)$connection->readLine());
}

$parser = new Parser($this->timezoneProvider->get($this->host));
$parser = new Parser('UTC');

$output = $connection->readAll();
if (isset($output[0])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Wrapped/Share.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(IServer $server, string $name, ISystem $system) {
$this->server = $server;
$this->name = $name;
$this->system = $system;
$this->parser = new Parser($server->getTimeZone());
$this->parser = new Parser('UTC');
}

private function getAuthFileArgument(): string {
Expand Down

0 comments on commit 76995aa

Please sign in to comment.