Download the PHP package kuikui/memcache-service-provider without Composer
On this page you can find all versions of the php package kuikui/memcache-service-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kuikui/memcache-service-provider
More information about kuikui/memcache-service-provider
Files in kuikui/memcache-service-provider
Package memcache-service-provider
Short Description Memcache integration for Silex.
License MIT
Homepage https://github.com/KuiKui/MemcacheServiceProvider
Informations about the package memcache-service-provider
Memcache service provider for Silex 2.x
It provides access to :
- a simple Memcache wrapper with very simple API for standard use,
- or your own Memcache wrapper with
$app
injection for custom use, - or a genuine Memcache(d) object for advanced use.
Installation
Create a composer.json in your projects root-directory :
and run :
Registering
Example
Options
After registration, you can customize the service with these options :
Connections
Allows you to set up one or more Memcache connections.
Each connection should be defined as follows array('ip_address', port)
.
Class
Allows you to choose between the two PHP Memcache libraries : \Memcache
or \Memcached
.
Wrapper
- By default, you access to an instance of
KuiKui\MemcacheServiceProvider\SimpleWrapper
. -
For custom needs, you can use your own wrapper :
- Or you can have direct acces to Memcache(d) object :
Duration
If you use SimpleWrapper
, you can configure the default duration of cached data (in seconds):
Running the tests
The development environment is provided by Vagrant and the Xotelia box.
Dependencies
PHP 5.5+
MemcacheServiceProvider needs one of these PHP modules to be installed :
Credits
Deeply inspired by MemcacheServiceProvider from Rafał Filipek.
Tested with atoum.
License
The MemcacheServiceProvider is licensed under the MIT license.