mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
add info about basic connection testing using the example script
This commit is contained in:
parent
0cbfd0872d
commit
2280570d28
2 changed files with 21 additions and 3 deletions
12
example.php
12
example.php
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue