add info about basic connection testing using the example script

This commit is contained in:
Robin Appelman 2018-03-09 15:01:40 +01:00
commit 2280570d28
2 changed files with 21 additions and 3 deletions

View file

@ -1,16 +1,22 @@
<?php
use Icewind\SMB\NativeServer;
use Icewind\SMB\Server;
require('vendor/autoload.php');
$host = 'localhost';
$user = 'test';
$password = 'test';
$share = 'test';
if (Server::NativeAvailable()) {
$server = new NativeServer('localhost', 'test', 'test');
$server = new NativeServer($host, $user, $password);
} else {
$server = new Server('localhost', 'test', 'test');
$server = new Server($host, $user, $password);
}
$share = $server->getShare('test');
$share = $server->getShare($share);
$files = $share->dir('/');
foreach ($files as $file) {