smb/example.php
Andy Scherzinger 8acffcd855
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-06-02 20:28:14 +02:00

25 lines
540 B
PHP

<?php
/**
* SPDX-FileCopyrightText: 2015 Robin Appelman <robin@icewind.nl>
* SPDX-License-Identifier: MIT
*/
require('vendor/autoload.php');
$host = 'localhost';
$user = 'test';
$workgroup = 'test';
$password = 'test';
$share = 'test';
$auth = new \Icewind\SMB\BasicAuth($user, $workgroup, $password);
$serverFactory = new \Icewind\SMB\ServerFactory();
$server = $serverFactory->createServer($host, $auth);
$share = $server->getShare($share);
$files = $share->dir('/');
foreach ($files as $file) {
echo $file->getName() . "\n";
}