mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 09:14:06 +02:00
move backends into their own namespace and add support for multiple auth methods
This commit is contained in:
parent
2280570d28
commit
29bdebad42
33 changed files with 752 additions and 377 deletions
11
example.php
11
example.php
|
|
@ -6,15 +6,14 @@ use Icewind\SMB\Server;
|
|||
require('vendor/autoload.php');
|
||||
|
||||
$host = 'localhost';
|
||||
$user = 'test';
|
||||
$user = 'test\test';
|
||||
$password = 'test';
|
||||
$share = 'test';
|
||||
|
||||
if (Server::NativeAvailable()) {
|
||||
$server = new NativeServer($host, $user, $password);
|
||||
} else {
|
||||
$server = new Server($host, $user, $password);
|
||||
}
|
||||
$auth = new \Icewind\SMB\BasicAuth($user, $password);
|
||||
$serverFactory = new \Icewind\SMB\ServerFactory();
|
||||
|
||||
$server = $serverFactory->createServer($host, $auth);
|
||||
|
||||
$share = $server->getShare($share);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue