Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whatwedo/flysystem-smb
Flysystem Icewind SMB Adapter
https://github.com/whatwedo/flysystem-smb
flysystem flysystem-adapter php-library samba smb
Last synced: about 1 month ago
JSON representation
Flysystem Icewind SMB Adapter
- Host: GitHub
- URL: https://github.com/whatwedo/flysystem-smb
- Owner: whatwedo
- Created: 2021-08-05T13:46:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T12:54:34.000Z (almost 2 years ago)
- Last Synced: 2024-09-26T22:47:39.245Z (3 months ago)
- Topics: flysystem, flysystem-adapter, php-library, samba, smb
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 13
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Flysystem SMB Adapter
This Flysystem adapter uses https://github.com/icewind1991/SMB
## Installation
```bash
composer require whatwedo/flysystem-smb
```## Usage
```php
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](LICENSE)