https://github.com/danhunsaker/flysystem-redis
A Flysystem adapter for storing files in Redis
https://github.com/danhunsaker/flysystem-redis
Last synced: 5 months ago
JSON representation
A Flysystem adapter for storing files in Redis
- Host: GitHub
- URL: https://github.com/danhunsaker/flysystem-redis
- Owner: danhunsaker
- License: mit
- Created: 2015-08-31T07:34:45.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2020-10-28T20:26:36.000Z (over 4 years ago)
- Last Synced: 2025-01-15T02:35:31.809Z (6 months ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 18
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flysystem Adapter for Redis
[](https://gitter.im/danhunsaker/flysystem-redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://liberapay.com/danhunsaker/)[](https://github.com/danhunsaker/flysystem-redis/releases)
[](LICENSE.md)
[](https://travis-ci.org/danhunsaker/flysystem-redis)
[](https://packagist.org/packages/danhunsaker/flysystem-redis)This is a [Redis](https://redis.io/) adapter for [Flysystem](http://flysystem.thephpleague.com/).
## Installation
Composer is the best way, as with all of Flysystem!
```bash
composer require danhunsaker/flysystem-redis
```## Usage
The usual. Create a client instance, pass it to the adapter, and pass that to the filesystem:
```php
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:
```php
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](https://github.com/danhunsaker/flysystem-redis) for everything else.