danhunsaker / flysystem-redis
A Flysystem adapter for storing files in Redis
Fund package maintenance!
danhunsaker
Patreon
Ko Fi
Liberapay
paypal.me/hunsakerdan
Installs: 120 886
Dependents: 0
Suggesters: 1
Security: 0
Stars: 18
Watchers: 5
Forks: 5
Open Issues: 0
Requires
- php: >=5.4.0
- league/flysystem: ^1.0
- predis/predis: ^1.0
Requires (Dev)
- phpunit/phpunit: ^5.7
README
This is a Redis adapter for Flysystem.
Installation
Composer is the best way, as with all of Flysystem!
composer require danhunsaker/flysystem-redis
Usage
The usual. Create a client instance, pass it to the adapter, and pass that to the filesystem:
use Predis\Client; use League\Flysystem\Filesystem; use Danhunsaker\Flysystem\Redis\RedisAdapter; $redis = new Client(); $adapter = new RedisAdapter($redis); $filesystem = new Filesystem($adapter);
If Predis's assumed defaults of 127.0.0.1
and 6379
for host and port (respectively) aren't sufficient, you can pass your own values, just as you normally would when setting up Predis elsewhere in your projects:
use Predis\Client; use League\Flysystem\Filesystem; use Danhunsaker\Flysystem\Redis\RedisAdapter; $redis = new Client([ 'scheme' => 'tcp', 'host' => '10.0.0.1', 'port' => 6379, ]); $adapter = new RedisAdapter($redis); $filesystem = new Filesystem($adapter);
See the Predis docs for more on how to set it up...
And head to GitHub for everything else.