Download the PHP package codemix/yiiredis without Composer
On this page you can find all versions of the php package codemix/yiiredis. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yiiredis
YiiRedis
Provides object oriented access to Redis in a familiar Yii Style. When you add or remove items from redis entities (lists, sets, sorted sets, hashes), changes are pushed to the server immediately, this is useful when your application needs to make information available across multiple requests.
This package relies on the https://github.com/nicolasff/phpredis PHP extension, please make sure this is installed before continuing.
Usage
Configuring The Redis Connection
Add the following to your application config
Storing and Retrieving simple keys
To store a simple value in a key and read it back:
Using lists
Redis lists are simple lists of values that are kept in the order that the items are added
Using sets
Redis sets are unordered lists of non repeatable values
Using Sorted Sets
Redis sorted sets are lists of non repeatable values where each value is associated with a score that affects the order of the results
Using Hashes
Redis Hashes are maps between string fields and string values, so they are the perfect data type to represent objects (eg: A User with a number of fields like name, surname, age, and so forth).
Using Pub/Sub
Redis allows us to subscribe to channels and publish messages to them.
Using Redis for Counters
Often we need to store counters for a particular database table or row, with YiiRedis this is fast and easy.
Using Redis for Mutexes
Mutexes are useful to ensure that only one client can access a particular resources at a time.
Using Redis for Caching
Redis is a good alternative to memcached for caching because its speed is comparable and the data is persisted.
In your app config:
Using Redis as a backend for Active Record
It is possible to store active record like structures in redis using ARedisRecord.
Note: this is experimental functionality and may be subject to change