kinetis / storage
File storage for Kinetis, built on League\Flysystem — local storage via a genuinely non-blocking Amp\File-backed adapter; remote backends (S3, etc.) live in kinetis/storage-s3.
Requires
- php: ^8.4
- amphp/byte-stream: ^2
- amphp/file: ^3.0
- kinetis/framework: ^1.6
- league/flysystem: ^3.35
- league/mime-type-detection: ^1.0
Requires (Dev)
- infection/infection: ^0.34.2
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^11.0
- vimeo/psalm: ^6.16
README
kinetis/storage
File storage for Kinetis, built on League\Flysystem
Read, write, delete, and list files against League\Flysystem's
FilesystemOperator interface — swappable to a different backend with no
application-code changes. Local storage is Kinetis's own backend,
Amp\File-backed rather than Flysystem's own local adapter, so every
operation genuinely suspends the calling Fiber instead of blocking the
whole worker process. Remote backends (S3, etc.) live in the separate
kinetis/storage-s3.
use Kinetis\Storage\FilesystemFactory; $storage = FilesystemFactory::fromConfig($config); $storage->write('avatars/user-42.png', $imageContents); $contents = $storage->read('avatars/user-42.png'); $storage->delete('avatars/user-42.png');
Configuration
Read from the environment (or .env) via Kinetis\Config. Every key
is scoped.
| Key | Default | Purpose |
|---|---|---|
FILESYSTEM_DRIVER |
local |
local, or s3 (needs kinetis/storage-s3). |
FILESYSTEM_ROOT |
(required for local) | Local disk root path. |
Scoped keys follow the named-connection convention — the connection
name inserts after the first segment: FILESYSTEM_ROOT + uploads → FILESYSTEM_UPLOADS_ROOT.
Full reference across every package:
docs.kinetis.dev/config.html.
Installation
composer require kinetis/storage
Requires PHP 8.4+ and kinetis/framework. Full documentation:
docs.kinetis.dev/storage.html.
License
MIT — see LICENSE.