Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danhunsaker/flysystem-redis
A Flysystem adapter for storing files in Redis
https://github.com/danhunsaker/flysystem-redis
Last synced: 5 days 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 (about 9 years ago)
- Default Branch: main
- Last Pushed: 2020-10-28T20:26:36.000Z (about 4 years ago)
- Last Synced: 2024-10-23T16:41:33.515Z (24 days 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
[![Join the chat at https://gitter.im/danhunsaker/flysystem-redis](https://badges.gitter.im/danhunsaker/flysystem-redis.svg)](https://gitter.im/danhunsaker/flysystem-redis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Liberapay receiving](https://img.shields.io/liberapay/receives/danhunsaker.svg?style=flat-square)](https://liberapay.com/danhunsaker/)[![Latest Version](https://img.shields.io/github/release/danhunsaker/flysystem-redis.svg?style=flat-square)](https://github.com/danhunsaker/flysystem-redis/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/danhunsaker/flysystem-redis/master.svg?style=flat-square)](https://travis-ci.org/danhunsaker/flysystem-redis)
[![Total Downloads](https://img.shields.io/packagist/dt/danhunsaker/flysystem-redis.svg?style=flat-square)](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.