Caching Library for VAPI Using Redis & Predis
=============================================

INSTALL
-------

Assuming you have a Unixy OS, PHP 5.3.x, and PHPUnit:

1.	Get composer: http://getcomposer.org/

	Again, this depends on your OS.

2.	Clone this here repo.

3.	Install composer dependencies

	Assuming you have composer in your PATH, just run the following command in the repo's root dir:

	```
	$ composer install
	```

	This will download all the necessary dependencies. Do *not* commit these files, but *do* commit your `composer.lock` file. For more information on the composer command, see: http://getcomposer.org/doc/00-intro.md

4.	Get redis: http://redis.io/

	The details of this step depends on your OS. Should be easy to set up from source or a package. Place the redis-server bin in your PATH.

5.	Set up your configuration files

	Redis needs to start with specific configuration options so that development and testing data do not conflict. Two shadow configurations are provided for this purpose: config/redis-test.conf_shadow and config/redis-dev.conf_shadow. A third file, config/redis-sample.conf_shadow, is provided with detailed explanations of available options.

	Do not start redis without using either the dev or test config files. If you do not use a configuration file, bad things will happen to your data. (Meaning: conflicts, failed tests, overwriting data.) Also do not use these shadow files directly. Instead rename them and keep your new files in the config directory. Gitignore will ignore any files ending in *.conf.

	To get started, rename the appropriate file from redis-{type}.conf_shadow to redis-{type}.conf. Finally, do not commit this new config file. If you do, you owe Charles $20 for every infraction.

6.	Start Redis

	In the /db directory issue the following command on the command line:

	```
	$ redis-server ../config/redis-test.conf
	$ redis-server ../config/redis-dev.conf
	```

	If you are using the settings from the default shadow files, Redis will be running on port 6380 (test) and 6379 (dev).

7. 	If you wish to see if things are working, then, in the root dir run:

	```
	$ phpunit
	```

	Tests should pass and you are on your way.

POSTSCRIPT
----------

If you need 100,000 test keys run the following:

```
$ phpunit test/MakeKeys.php
```

PHPUnit will populate the dev db with 100,000 test keys. Although generated by phpunit, they won't conflict with your test DB keys, but it *will* delete any other dev data you have.

USAGE
-----

* [Class documentation can be found here](usage.md)
* [Instructions on how to clear cache entries programmatically can be found here](cache-clearance.md)

ALSO SEE
--------

* http://redis.io/
* https://github.com/nrk/predis
* http://getcomposer.org/

ALSO ALSO SEE
-------------

<pre>

                                                    /
                                                  .7
                                       \       , //
                                       |\.--._/|//
                                      /\ ) ) ).'/
                                     /(  \  // /
                                    /(   J`((_/ \
                                   / ) | _\     /
                                  /|)  \  eJ    L
                                 |  \ L \   L   L
                                /  \  J  `. J   L
                                |  )   L   \/   \
                               /  \    J   (\   /
             _....___         |  \      \   \```
      ,.._.-'        '''--...-||\     -. \   \
    .'.=.'                    `         `.\ [ Y
   /   /                                  \]  J
  Y / Y                                    Y   L
  | | |          \                         |   L
  | | |           Y                        A  J
  |   I           |                       /I\ /
  |    \          I             \        ( |]/|
  J     \         /._           /        -tI/ |
   L     )       /   /'-------'J           `'-:.
   J   .'      ,'  ,' ,     \   `'-.__          \
    \ T      ,'  ,'   )\    /|        ';'---7   /
     \|    ,'L  Y...-' / _.' /         \   /   /
      J   Y  |  J    .'-'   /         ,--.(   /
       L  |  J   L -'     .'         /  |    /\
       |  J.  L  J     .-;.-/       |    \ .' /
       J   L`-J   L____,.-'`        |  _.-'   |
        L  J   L  J                  ``  J    |
        J   L  |   L                     J    |
         L  J  L    \                    L    \
         |   L  ) _.'\                    ) _.'\
         L    \('`    \                  ('`    \
          ) _.'\`-....'                   `-....'
         ('`    \
          `-.___/   sk
</pre>