update README

This commit is contained in:
Robin Appelman 2014-07-12 17:37:00 +02:00
commit e58b72e488

View file

@ -1,11 +1,12 @@
SMB
===
PHP wrapper for `smbclient`
PHP wrapper for `smbclient` and [`libsmbclient-php`](https://github.com/eduardok/libsmbclient-php)
- Reuses a single `smbclient` instance for multiple requests
- Doesn't leak the password to the process list
- Simple 1-on-1 mapping of SMB commands
- Support for using libsmbclient directly trough [`libsmbclient-php`](https://github.com/eduardok/libsmbclient-php)
Examples
----
@ -73,3 +74,26 @@ foreach ($content as $name => $info) {
echo "\tsize :" . $info['size'] . "\n";
}
```
### Using [libsmbclient-php](https://github.com/eduardok/libsmbclient-php) ###
Install [libsmbclient-php](https://github.com/eduardok/libsmbclient-php)
```php
<?php
use Icewind\SMB\Server;
use Icewind\SMB\NativeServer;
require('vendor/autoload.php');
$fileToUpload = __FILE__;
if (Server::NativeAvailable()) {
$server = new NativeServer('localhost', 'test', 'test');
} else {
echo 'libsmbclient-php not available, falling back to wrapping smbclient';
$server = new Server('localhost', 'test', 'test');
}
$share = $server->getShare('test');
$share->put($fileToUpload, 'example.txt');
```