add example file

close smbclient connections properly
This commit is contained in:
root 2015-04-10 09:16:28 +02:00
commit 3a75f15ca3
3 changed files with 35 additions and 0 deletions

20
example.php Normal file
View file

@ -0,0 +1,20 @@
<?php
use Icewind\SMB\NativeServer;
use Icewind\SMB\Server;
require('vendor/autoload.php');
if (Server::NativeAvailable()) {
$server = new NativeServer('localhost', 'test', 'test');
} else {
$server = new Server('localhost', 'test', 'test');
}
$share = $server->getShare('test');
$share->put(__FILE__, 'example.php');
$files = $share->dir('/');
foreach ($files as $file) {
echo $file->getName() . "\n";
}