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
89d73346f2
commit
fd8bed7fb6
1 changed files with 33 additions and 0 deletions
33
README.md
33
README.md
|
|
@ -9,6 +9,7 @@ PHP wrapper for `smbclient` and [`libsmbclient-php`](https://github.com/eduardok
|
|||
- 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
|
||||
- A stream-based api to remove the need for temporary files
|
||||
- Support for using libsmbclient directly trough [`libsmbclient-php`](https://github.com/eduardok/libsmbclient-php)
|
||||
|
||||
Examples
|
||||
|
|
@ -78,6 +79,38 @@ foreach ($content as $name => $info) {
|
|||
}
|
||||
```
|
||||
|
||||
### Using read streams
|
||||
|
||||
```php
|
||||
<?php
|
||||
use Icewind\SMB\Server;
|
||||
|
||||
require('vendor/autoload.php');
|
||||
|
||||
$server = new Server('localhost', 'test', 'test');
|
||||
$share = $server->getShare('test');
|
||||
|
||||
$fh = $share->read('test.txt');
|
||||
echo fread($fh, 4086);
|
||||
fclose($fh);
|
||||
```
|
||||
|
||||
### Using write streams
|
||||
|
||||
```php
|
||||
<?php
|
||||
use Icewind\SMB\Server;
|
||||
|
||||
require('vendor/autoload.php');
|
||||
|
||||
$server = new Server('localhost', 'test', 'test');
|
||||
$share = $server->getShare('test');
|
||||
|
||||
$fh = $share->write('test.txt');
|
||||
fwrite($fh, 'bar');
|
||||
fclose($fh);
|
||||
```
|
||||
|
||||
### Using [libsmbclient-php](https://github.com/eduardok/libsmbclient-php) ###
|
||||
|
||||
Install [libsmbclient-php](https://github.com/eduardok/libsmbclient-php)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue