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
```php
<?php
// Create the pool
// $config is the configuration array
// $logger is an optional psr/log compatible logger
$pool = new Aviat\Banker\Pool($config, $logger);
// 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:
```php
[
<?php
$config = [
'driver' => 'null', // null, redis, memcache, memcached
'connection' => [
// 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
// Memcached, or a prefix for Redis keys
]
]
];
```
Below are the connection arrays for each backend:
Memcache / Memcached:
```php
[
<?php
$config['connection'] = [
'host' => 'localhost', // hostname or socket
'port' => 11211, // Port needs to be 0 if socket
'persistent' => false, // Use persistent connection
]
];
```
Redis: