mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-04 01:34:07 +02:00
25 lines
540 B
PHP
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";
|
|
}
|