Skip to content
This repository has been archived by the owner on Nov 8, 2020. It is now read-only.

mheap/Silex-Memcache

Repository files navigation

Silex-Memcache

Build Status

Requirements

This extension only works with PHP 7.1+, Silex 2 and the Memcached driver. Version 1.0.0 is compatible with Silex 1 and both the Memcache/Memcached drivers.

Installation

Install with composer:

composer require mheap/silex-memcache

Usage

Before you can use this extension you need to register it with your application. You can specify a list of servers to connect to at this point

$app->register(new SilexMemcache\MemcacheExtension(), array(
    'memcache.server' => array(
        array('127.0.0.1', 11211)
    )
));

Once the extension is registered, it'll be available as $app['memcache']:

$app->get('/', function() use($app) {
    $app['memcache']->set('my_value', 'This is an example');
    $value = $app['memcache']->get('my_value');
});

Running the tests

You'll need memcached running on port 11211 locally to run the tests. If you don't have memcached installed you can run docker-compose up to run it in a container instead.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published