example.php | example.php | ||||
icewind/smb/tests | icewind/smb/tests | ||||
icewind/smb/install_libsmbclient.sh | icewind/smb/install_libsmbclient.sh | ||||
icewind/smb/Makefile | |||||
icewind/smb/.travis.yml | icewind/smb/.travis.yml | ||||
icewind/smb/.scrutinizer.yml | icewind/smb/.scrutinizer.yml | ||||
icewind/streams/tests | icewind/streams/tests |
"classmap-authoritative": true | "classmap-authoritative": true | ||||
}, | }, | ||||
"require": { | "require": { | ||||
"icewind/smb": "2.0.4", | |||||
"icewind/streams": "0.5.2" | |||||
"icewind/streams": "0.5.2", | |||||
"icewind/smb": "2.0.5" | |||||
} | } | ||||
} | } | ||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | ||||
"This file is @generated automatically" | "This file is @generated automatically" | ||||
], | ], | ||||
"content-hash": "8b87ff18cd1c30945c631607fbfbf8b7", | |||||
"content-hash": "53a1e7ab19e98c20c720cab0340bc56a", | |||||
"packages": [ | "packages": [ | ||||
{ | { | ||||
"name": "icewind/smb", | "name": "icewind/smb", | ||||
"version": "v2.0.4", | |||||
"version": "v2.0.5", | |||||
"source": { | "source": { | ||||
"type": "git", | "type": "git", | ||||
"url": "https://github.com/icewind1991/SMB.git", | "url": "https://github.com/icewind1991/SMB.git", | ||||
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd" | |||||
"reference": "b888dd81bd05532677e1469849d9065011256a33" | |||||
}, | }, | ||||
"dist": { | "dist": { | ||||
"type": "zip", | "type": "zip", | ||||
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/f258947a6f840cc9655ba81744872f9bb292a7dd", | |||||
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd", | |||||
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/b888dd81bd05532677e1469849d9065011256a33", | |||||
"reference": "b888dd81bd05532677e1469849d9065011256a33", | |||||
"shasum": "" | "shasum": "" | ||||
}, | }, | ||||
"require": { | "require": { | ||||
} | } | ||||
], | ], | ||||
"description": "php wrapper for smbclient and libsmbclient-php", | "description": "php wrapper for smbclient and libsmbclient-php", | ||||
"time": "2018-01-19T14:36:36+00:00" | |||||
"time": "2018-03-28T13:51:31+00:00" | |||||
}, | }, | ||||
{ | { | ||||
"name": "icewind/streams", | "name": "icewind/streams", |
'Icewind\\Streams\\PathWrapper' => $vendorDir . '/icewind/streams/src/PathWrapper.php', | 'Icewind\\Streams\\PathWrapper' => $vendorDir . '/icewind/streams/src/PathWrapper.php', | ||||
'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php', | 'Icewind\\Streams\\RetryWrapper' => $vendorDir . '/icewind/streams/src/RetryWrapper.php', | ||||
'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.php', | 'Icewind\\Streams\\SeekableWrapper' => $vendorDir . '/icewind/streams/src/SeekableWrapper.php', | ||||
'Icewind\\Streams\\Tests\\CallbackWrapper' => $vendorDir . '/icewind/streams/tests/CallbackWrapper.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\\DirectoryFilter' => $vendorDir . '/icewind/streams/tests/DirectoryFilter.php', | ||||
'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', | 'Icewind\\Streams\\Tests\\DirectoryWrapper' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => $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\\DirectoryWrapperNull' => $vendorDir . '/icewind/streams/tests/DirectoryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\FailWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | 'Icewind\\Streams\\Tests\\FailWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php', | 'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php', | ||||
'Icewind\\Streams\\Tests\\NullWrapper' => $vendorDir . '/icewind/streams/tests/NullWrapper.php', | |||||
'Icewind\\Streams\\Tests\\NullWrapperTest' => $vendorDir . '/icewind/streams/tests/NullWrapperTest.php', | |||||
'Icewind\\Streams\\Tests\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | 'Icewind\\Streams\\Tests\\PartialWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\PathWrapper' => $vendorDir . '/icewind/streams/tests/PathWrapper.php', | 'Icewind\\Streams\\Tests\\PathWrapper' => $vendorDir . '/icewind/streams/tests/PathWrapper.php', | ||||
'Icewind\\Streams\\Tests\\RetryWrapper' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | |||||
'Icewind\\Streams\\Tests\\RetryWrapperTest' => $vendorDir . '/icewind/streams/tests/RetryWrapper.php', | |||||
'Icewind\\Streams\\Tests\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php', | 'Icewind\\Streams\\Tests\\SeekableWrapper' => $vendorDir . '/icewind/streams/tests/SeekableWrapper.php', | ||||
'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.php', | 'Icewind\\Streams\\Tests\\UrlCallBack' => $vendorDir . '/icewind/streams/tests/UrlCallBack.php', | ||||
'Icewind\\Streams\\Tests\\Wrapper' => $vendorDir . '/icewind/streams/tests/Wrapper.php', | |||||
'Icewind\\Streams\\Tests\\WrapperTest' => $vendorDir . '/icewind/streams/tests/WrapperTest.php', | |||||
'Icewind\\Streams\\Url' => $vendorDir . '/icewind/streams/src/Url.php', | 'Icewind\\Streams\\Url' => $vendorDir . '/icewind/streams/src/Url.php', | ||||
'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php', | 'Icewind\\Streams\\UrlCallback' => $vendorDir . '/icewind/streams/src/UrlCallBack.php', | ||||
'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php', | 'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php', |
'Icewind\\Streams\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/src/PathWrapper.php', | 'Icewind\\Streams\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/src/PathWrapper.php', | ||||
'Icewind\\Streams\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/src/RetryWrapper.php', | 'Icewind\\Streams\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/src/RetryWrapper.php', | ||||
'Icewind\\Streams\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/src/SeekableWrapper.php', | 'Icewind\\Streams\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/src/SeekableWrapper.php', | ||||
'Icewind\\Streams\\Tests\\CallbackWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/CallbackWrapper.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\\DirectoryFilter' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryFilter.php', | ||||
'Icewind\\Streams\\Tests\\DirectoryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', | 'Icewind\\Streams\\Tests\\DirectoryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\DirectoryWrapperDummy' => __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\\DirectoryWrapperNull' => __DIR__ . '/..' . '/icewind/streams/tests/DirectoryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\FailWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | 'Icewind\\Streams\\Tests\\FailWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\IteratorDirectory' => __DIR__ . '/..' . '/icewind/streams/tests/IteratorDirectory.php', | 'Icewind\\Streams\\Tests\\IteratorDirectory' => __DIR__ . '/..' . '/icewind/streams/tests/IteratorDirectory.php', | ||||
'Icewind\\Streams\\Tests\\NullWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/NullWrapper.php', | |||||
'Icewind\\Streams\\Tests\\NullWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/NullWrapperTest.php', | |||||
'Icewind\\Streams\\Tests\\PartialWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | 'Icewind\\Streams\\Tests\\PartialWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | ||||
'Icewind\\Streams\\Tests\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/PathWrapper.php', | 'Icewind\\Streams\\Tests\\PathWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/PathWrapper.php', | ||||
'Icewind\\Streams\\Tests\\RetryWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | |||||
'Icewind\\Streams\\Tests\\RetryWrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/RetryWrapper.php', | |||||
'Icewind\\Streams\\Tests\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/SeekableWrapper.php', | 'Icewind\\Streams\\Tests\\SeekableWrapper' => __DIR__ . '/..' . '/icewind/streams/tests/SeekableWrapper.php', | ||||
'Icewind\\Streams\\Tests\\UrlCallBack' => __DIR__ . '/..' . '/icewind/streams/tests/UrlCallBack.php', | 'Icewind\\Streams\\Tests\\UrlCallBack' => __DIR__ . '/..' . '/icewind/streams/tests/UrlCallBack.php', | ||||
'Icewind\\Streams\\Tests\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/tests/Wrapper.php', | |||||
'Icewind\\Streams\\Tests\\WrapperTest' => __DIR__ . '/..' . '/icewind/streams/tests/WrapperTest.php', | |||||
'Icewind\\Streams\\Url' => __DIR__ . '/..' . '/icewind/streams/src/Url.php', | 'Icewind\\Streams\\Url' => __DIR__ . '/..' . '/icewind/streams/src/Url.php', | ||||
'Icewind\\Streams\\UrlCallback' => __DIR__ . '/..' . '/icewind/streams/src/UrlCallBack.php', | 'Icewind\\Streams\\UrlCallback' => __DIR__ . '/..' . '/icewind/streams/src/UrlCallBack.php', | ||||
'Icewind\\Streams\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/src/Wrapper.php', | 'Icewind\\Streams\\Wrapper' => __DIR__ . '/..' . '/icewind/streams/src/Wrapper.php', |
[ | [ | ||||
{ | { | ||||
"name": "icewind/smb", | "name": "icewind/smb", | ||||
"version": "v2.0.4", | |||||
"version_normalized": "2.0.4.0", | |||||
"version": "v2.0.5", | |||||
"version_normalized": "2.0.5.0", | |||||
"source": { | "source": { | ||||
"type": "git", | "type": "git", | ||||
"url": "https://github.com/icewind1991/SMB.git", | "url": "https://github.com/icewind1991/SMB.git", | ||||
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd" | |||||
"reference": "b888dd81bd05532677e1469849d9065011256a33" | |||||
}, | }, | ||||
"dist": { | "dist": { | ||||
"type": "zip", | "type": "zip", | ||||
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/f258947a6f840cc9655ba81744872f9bb292a7dd", | |||||
"reference": "f258947a6f840cc9655ba81744872f9bb292a7dd", | |||||
"url": "https://api.github.com/repos/icewind1991/SMB/zipball/b888dd81bd05532677e1469849d9065011256a33", | |||||
"reference": "b888dd81bd05532677e1469849d9065011256a33", | |||||
"shasum": "" | "shasum": "" | ||||
}, | }, | ||||
"require": { | "require": { | ||||
"require-dev": { | "require-dev": { | ||||
"phpunit/phpunit": "^4.8" | "phpunit/phpunit": "^4.8" | ||||
}, | }, | ||||
"time": "2018-01-19T14:36:36+00:00", | |||||
"time": "2018-03-28T13:51:31+00:00", | |||||
"type": "library", | "type": "library", | ||||
"installation-source": "source", | |||||
"installation-source": "dist", | |||||
"autoload": { | "autoload": { | ||||
"psr-4": { | "psr-4": { | ||||
"Icewind\\SMB\\": "src/", | "Icewind\\SMB\\": "src/", |
parent::write($input . PHP_EOL); | parent::write($input . PHP_EOL); | ||||
} | } | ||||
/** | |||||
* @throws ConnectException | |||||
*/ | |||||
public function clearTillPrompt() { | public function clearTillPrompt() { | ||||
$this->write(''); | $this->write(''); | ||||
do { | do { | ||||
$promptLine = $this->readLine(); | $promptLine = $this->readLine(); | ||||
$this->parser->checkConnectionError($promptLine); | |||||
} while (!$this->isPrompt($promptLine)); | } while (!$this->isPrompt($promptLine)); | ||||
$this->write(''); | $this->write(''); | ||||
$this->readLine(); | $this->readLine(); |
<?php | |||||
/** | |||||
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> | |||||
* This file is licensed under the Licensed under the MIT license: | |||||
* http://opensource.org/licenses/MIT | |||||
*/ | |||||
namespace Icewind\SMB\Exception; | |||||
class InvalidArgumentException extends InvalidRequestException {} |
* @throws AuthenticationException | * @throws AuthenticationException | ||||
* @throws InvalidHostException | * @throws InvalidHostException | ||||
* @throws NoLoginServerException | * @throws NoLoginServerException | ||||
* @throws AccessDeniedException | |||||
*/ | */ | ||||
public function checkConnectionError($line) { | public function checkConnectionError($line) { | ||||
$line = rtrim($line, ')'); | $line = rtrim($line, ')'); | ||||
if (substr($line, -26) === ErrorCodes::NoLogonServers) { | if (substr($line, -26) === ErrorCodes::NoLogonServers) { | ||||
throw new NoLoginServerException('No login server'); | throw new NoLoginServerException('No login server'); | ||||
} | } | ||||
if (substr($line, -23) === ErrorCodes::AccessDenied) { | |||||
throw new AccessDeniedException('Access denied'); | |||||
} | |||||
} | } | ||||
public function parseMode($mode) { | public function parseMode($mode) { | ||||
return [ | return [ | ||||
'mtime' => strtotime($data['write_time']), | 'mtime' => strtotime($data['write_time']), | ||||
'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '('), -1)), | 'mode' => hexdec(substr($data['attributes'], strpos($data['attributes'], '('), -1)), | ||||
'size' => isset($data['stream']) ? (int)explode(' ', $data['stream'])[1] : 0 | |||||
'size' => isset($data['stream']) ? (int)(explode(' ', $data['stream'])[1]) : 0 | |||||
]; | ]; | ||||
} | } | ||||