whatwedo / flysystem-smb
smb icewind adapter for Flysystem.
Installs: 13 188
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 13
Forks: 2
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- icewind/smb: ^3.4
- league/flysystem: ^2.0|^3.0
- league/mime-type-detection: ^1.0.0
This package is auto-updated.
Last update: 2024-10-09 16:19:50 UTC
README
This Flysystem adapter uses https://github.com/icewind1991/SMB
Installation
composer require whatwedo/flysystem-smb
Usage
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]);
Known Issues
- Visibility is set by using
\Icewind\SMB\Wrapped\FileInfo::MODE_HIDDEN
- function
mimeType(string $path)
can be buggy
License
This bundle is under the MIT license. See the complete license in the bundle: LICENSE