update icewind/smb to 3.0.1

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-02-06 18:12:41 +01:00
parent 3e72cc16e7
commit 23d4e910a8
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
9 changed files with 33 additions and 51 deletions

View File

@ -9,6 +9,6 @@
},
"require": {
"icewind/streams": "0.6.1",
"icewind/smb": "3.0.0"
"icewind/smb": "3.0.1"
}
}

View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1465c8a4b4139e514086d5803d90af2d",
"content-hash": "2cf7fdc531a149399b36b1a7a92ba79b",
"packages": [
{
"name": "icewind/smb",
"version": "v3.0.0",
"version": "v3.0.1",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "0d31da4757a37d322e1e181f2286e8a4c89fbc0c"
"reference": "bd43cdecd09ffe289fd2881761d4c72e60c95aeb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/0d31da4757a37d322e1e181f2286e8a4c89fbc0c",
"reference": "0d31da4757a37d322e1e181f2286e8a4c89fbc0c",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/bd43cdecd09ffe289fd2881761d4c72e60c95aeb",
"reference": "bd43cdecd09ffe289fd2881761d4c72e60c95aeb",
"shasum": ""
},
"require": {
@ -45,7 +45,7 @@
}
],
"description": "php wrapper for smbclient and libsmbclient-php",
"time": "2018-05-24T09:48:51+00:00"
"time": "2019-02-06T16:53:32+00:00"
},
{
"name": "icewind/streams",

View File

@ -279,7 +279,7 @@ class ClassLoader
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {

View File

@ -72,21 +72,6 @@ return array(
'Icewind\\Streams\\PathWrapper' => $vendorDir . '/icewind/streams/src/PathWrapper.php',
'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php',
'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\CallbackWrapperTest' => $vendorDir . '/icewind/streams/tests/CallbackWrapperTest.php',
'Icewind\\Streams\\Tests\\CountWrapperTest' => $vendorDir . '/icewind/streams/tests/CountWrapperTest.php',
'Icewind\\Streams\\Tests\\DirectoryFilter' => $vendorDir . '/icewind/streams/tests/DirectoryFilter.php',
'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperNull' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\FailWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php',
'Icewind\\Streams\\Tests\\NullWrapperTest' => $vendorDir . '/icewind/streams/tests/NullWrapperTest.php',
'Icewind\\Streams\\Tests\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\PathWrapper' => $vendorDir . '/icewind/streams/tests/PathWrapper.php',
'Icewind\\Streams\\Tests\\RetryWrapperTest' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.php',
'Icewind\\Streams\\Tests\\WrapperTest' => $vendorDir . '/icewind/streams/tests/WrapperTest.php',
'Icewind\\Streams\\Url' => $vendorDir . '/icewind/streams/src/Url.php',
'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php',
'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php',

View File

@ -102,21 +102,6 @@ class ComposerStaticInit98fe9b281934250b3a93f69a5ce843b3
'Icewind\\Streams\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/src/PathWrapper.php',
'Icewind\\Streams\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/src/RetryWrapper.php',
'Icewind\\Streams\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/src/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\CallbackWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/CallbackWrapperTest.php',
'Icewind\\Streams\\Tests\\CountWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/CountWrapperTest.php',
'Icewind\\Streams\\Tests\\DirectoryFilter' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryFilter.php',
'Icewind\\Streams\\Tests\\DirectoryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\DirectoryWrapperNull' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php',
'Icewind\\Streams\\Tests\\FailWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\IteratorDirectory' => __DIR__ . '/..' . '/icewind/streams/tests/IteratorDirectory.php',
'Icewind\\Streams\\Tests\\NullWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/NullWrapperTest.php',
'Icewind\\Streams\\Tests\\PartialWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/PathWrapper.php',
'Icewind\\Streams\\Tests\\RetryWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php',
'Icewind\\Streams\\Tests\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/SeekableWrapper.php',
'Icewind\\Streams\\Tests\\UrlCallBack' => __DIR__ . '/..' . '/icewind/streams/tests/UrlCallBack.php',
'Icewind\\Streams\\Tests\\WrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/WrapperTest.php',
'Icewind\\Streams\\Url' => __DIR__ . '/..' . '/icewind/streams/src/Url.php',
'Icewind\\Streams\\UrlCallback' => __DIR__ . '/..' . '/icewind/streams/src/UrlCallBack.php',
'Icewind\\Streams\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/src/Wrapper.php',

View File

@ -1,17 +1,17 @@
[
{
"name": "icewind/smb",
"version": "v3.0.0",
"version_normalized": "3.0.0.0",
"version": "v3.0.1",
"version_normalized": "3.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/icewind1991/SMB.git",
"reference": "0d31da4757a37d322e1e181f2286e8a4c89fbc0c"
"reference": "bd43cdecd09ffe289fd2881761d4c72e60c95aeb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/0d31da4757a37d322e1e181f2286e8a4c89fbc0c",
"reference": "0d31da4757a37d322e1e181f2286e8a4c89fbc0c",
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/bd43cdecd09ffe289fd2881761d4c72e60c95aeb",
"reference": "bd43cdecd09ffe289fd2881761d4c72e60c95aeb",
"shasum": ""
},
"require": {
@ -21,7 +21,7 @@
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"time": "2018-05-24T09:48:51+00:00",
"time": "2019-02-06T16:53:32+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {

View File

@ -16,6 +16,8 @@ class System {
private $stdbuf;
private $date;
public static function getFD($num) {
$folders = [
'/proc/self/fd',
@ -43,6 +45,13 @@ class System {
return $this->net;
}
public function getDatePath() {
if (!$this->date) {
$this->date = trim(`which date`);
}
return $this->date;
}
public function hasStdBuf() {
if (!$this->stdbuf) {
$result = null;

View File

@ -43,10 +43,13 @@ class TimeZoneProvider {
);
$this->timeZone = exec($command);
}
if ($this->timeZone) {
// fallback to server timezone
$this->timeZone = date_default_timezone_get();
if (!$this->timeZone) { // fallback to server timezone
$date = $this->system->getDatePath();
if ($date) {
$this->timeZone = exec($date . " +%z");
} else {
$this->timeZone = date_default_timezone_get();
}
}
}
return $this->timeZone;

View File

@ -13,7 +13,6 @@ use Icewind\SMB\Exception\DependencyException;
use Icewind\SMB\Exception\FileInUseException;
use Icewind\SMB\Exception\InvalidTypeException;
use Icewind\SMB\Exception\NotFoundException;
use Icewind\SMB\IFileInfo;
use Icewind\SMB\INotifyHandler;
use Icewind\SMB\IServer;
use Icewind\SMB\System;
@ -159,13 +158,14 @@ class Share extends AbstractShare {
if ($path !== "" && $path !== "/") {
$parent = dirname($path);
$dir = $this->dir($parent);
$file = array_values(array_filter($dir, function(IFileInfo $info) use ($path) {
$file = array_values(array_filter($dir, function(FileInfo $info) use ($path) {
return $info->getPath() === $path;
}));
if ($file) {
return $file[0];
}
}
$escapedPath = $this->escapePath($path);
$output = $this->execute('allinfo ' . $escapedPath);
// Windows and non Windows Fileserver may respond different