whatwedo/flysystem-smb

Flysystem 的 SMB 冰风适配器。

0.2.0 2023-02-08 18:07 UTC

This package is auto-updated.

Last update: 2024-09-09 16:06:59 UTC


README

此 Flysystem 适配器使用 https://github.com/icewind1991/SMB

安装

composer require whatwedo/flysystem-smb

用法

use League\Flysystem\Filesystem;
use League\Flysystem\Memory\MemoryAdapter;


$serverFactory = new \Icewind\SMB\ServerFactory();
$auth = new \Icewind\SMB\BasicAuth('medsuite', 'workgroup', 'medsuite');
$server = $serverFactory->createServer('localhost', $auth);

$share = $server->getShare('Medsuite Share');
        
$filesystem = new Filesystem(new SmbAdapter($share));

$filesystem->write('new_file.txt', 'yay a new text file!');

$contents = $filesystem->read('new_file.txt');

// Explicitly set timestamp (e.g. for testing)
$filesystem->write('old_file.txt', 'very old content', ['timestamp' => 13377331]);

已知问题

  • 可见性是通过使用 \Icewind\SMB\Wrapped\FileInfo::MODE_HIDDEN 设置的
  • mimeType(string $path) 函数可能存在错误

许可证

此软件包采用 MIT 许可证。请参阅软件包中的完整许可证:LICENSE