mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
update README
This commit is contained in:
parent
3c67574fff
commit
e58b72e488
1 changed files with 25 additions and 1 deletions
26
README.md
26
README.md
|
|
@ -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');
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue