06.10.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Redis<br />

• Introduction<br />

• Basic Usage A> - Pipelining Commands<br />

• Pub / Sub<br />

Introduction<br />

Redis²⁰³ is an open source, advanced key-value store. It is often referred to as a data structure server<br />

since keys can contain strings²⁰⁴, hashes²⁰⁵, lists²⁰⁶, sets²⁰⁷, and sorted sets²⁰⁸. Before using Redis with<br />

Laravel, you will need to install the predis/predis package (∼1.0) via Composer.<br />

Configuration<br />

The Redis configuration for your application is located in the config/database.php configuration<br />

file. Within this file, you will see a redis array containing the Redis servers used by your application:<br />

1 'redis' => [<br />

2<br />

3 'cluster' => false,<br />

4<br />

5 'default' => [<br />

6 'host' => '127.0.0.1',<br />

7 'port' => 6379,<br />

8 'database' => 0,<br />

9 ],<br />

10<br />

11 ],<br />

²⁰³http://redis.io<br />

²⁰⁴http://redis.io/topics/data-types#strings<br />

²⁰⁵http://redis.io/topics/data-types#hashes<br />

²⁰⁶http://redis.io/topics/data-types#lists<br />

²⁰⁷http://redis.io/topics/data-types#sets<br />

²⁰⁸http://redis.io/topics/data-types#sorted-sets<br />

437

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!