Update the README some more
This commit is contained in:
parent
b639c5ce87
commit
d63dbdbca3
13
README.md
13
README.md
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user