Multi-filesystem file provider with prefix routing, image processing, cached file helpers, and Resumable.js upload.
You write @blfs/image.jpg, FileProvider routes to S3. You chain ->cover(300, 200)->read(), it processes on the fly. You never touch Flysystem directly.
composer require blackcube/fileprovideruse Blackcube\FileProvider\FileProvider;
use Blackcube\FileProvider\Flysystem\FlysystemLocal;
use Yiisoft\Aliases\Aliases;
$provider = new FileProvider(new Aliases());
$provider->addFilesystem('@bltmp', new FlysystemLocal('/tmp/uploads'));
$provider->addFilesystem('@blfs', new FlysystemLocal('/var/www/storage'));
// Write, move, read
$provider->write('@bltmp/upload.jpg', $content);
$provider->move('@bltmp/upload.jpg', '@blfs/images/photo.jpg');
$content = $provider->read('@blfs/images/photo.jpg');
// Image processing (requires intervention/image)
$thumbnail = $provider->cover(200, 200)->read('@blfs/images/photo.jpg');# Unit tests (Provider, Integration, Local suites)
make test-unit
# Functional tests (starts HTTP server)
make test-functional
# All tests
make test- Overview & prerequisites
- Installation (standalone)
- Installation (Yii)
- API — FileProvider
- API — CacheFile
- API — Resumable
BSD-3-Clause. See LICENSE.md.
Philippe Gaultier philippe@blackcube.io