Update the README some more

This commit is contained in:
Timothy Warren 2016-09-07 11:01:07 -04:00
parent b639c5ce87
commit d63dbdbca3

View File

@ -11,7 +11,10 @@ backends
### Basic Usage ### Basic Usage
```php ```php
<?php
// Create the pool // Create the pool
// $config is the configuration array
// $logger is an optional psr/log compatible logger
$pool = new Aviat\Banker\Pool($config, $logger); $pool = new Aviat\Banker\Pool($config, $logger);
// Grab an item from the cache // Grab an item from the cache
@ -37,7 +40,8 @@ which server to connect to. Regardless of the backend, the basic
structure is like so: structure is like so:
```php ```php
[ <?php
$config = [
'driver' => 'null', // null, redis, memcache, memcached 'driver' => 'null', // null, redis, memcache, memcached
'connection' => [ 'connection' => [
// driver setup, see below for the structure for each // driver setup, see below for the structure for each
@ -48,18 +52,19 @@ structure is like so:
// Set additional driver-specific options, like persistence for // Set additional driver-specific options, like persistence for
// Memcached, or a prefix for Redis keys // Memcached, or a prefix for Redis keys
] ]
] ];
``` ```
Below are the connection arrays for each backend: Below are the connection arrays for each backend:
Memcache / Memcached: Memcache / Memcached:
```php ```php
[ <?php
$config['connection'] = [
'host' => 'localhost', // hostname or socket 'host' => 'localhost', // hostname or socket
'port' => 11211, // Port needs to be 0 if socket 'port' => 11211, // Port needs to be 0 if socket
'persistent' => false, // Use persistent connection 'persistent' => false, // Use persistent connection
] ];
``` ```
Redis: Redis: