alex-kalanis/redis-wrapper

PHP wrapper for questioning Redis as file storage

v2.0.4 2024-03-29 08:45 UTC

This package is auto-updated.

Last update: 2024-11-29 10:12:09 UTC


README

Build Status Latest Stable Version Minimum PHP Version Downloads License

Use Redis records as they were files. You can use either Redis module for PHP or Predis library for accesing the cluster.

Installation

composer.phar require alex-kalanis/redis-wrapper

(Refer to Composer Documentation if you are not familiar with composer)

Usages

Just only initialize wrapper with your Redis instance.

Redis module:

    $redis = new \Redis();
    RedisWrapper::setRedis($redis);
    RedisWrapper::register();

Predis library:

    $redis = new \Predis\Client();
    PredisWrapper::setRedisClient($redis);
    PredisWrapper::register();

Then for both:

    file_get_contents('redis://any/key/in/redis/storage');
    file_put_contents('redis://another/key/in/storage', 'add something');

For using storage just look onto kw_storage readme.