mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
add example file
This commit is contained in:
parent
476980d4ce
commit
ef4b128143
2 changed files with 21 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
.idea
|
.idea
|
||||||
vendor
|
vendor
|
||||||
|
composer.lock
|
||||||
|
|
|
||||||
20
example.php
Normal file
20
example.php
Normal 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";
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue