2017 © Pedro Peláez
 

symfony-bundle memcached-bundle

Smyfony Bundle which provides integration for Memcached

image

isl/memcached-bundle

Smyfony Bundle which provides integration for Memcached

  • Thursday, November 3, 2016
  • by bl@is-leibinger.de
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

IslMemcachedBundle

This Symfony Bundle provide Memcached integration into Symfony. It provides the configured pools as Singleton., (*1)

The Bundle is inpsired by: https://gist.github.com/benr77/258e42642b4632d5a826 https://github.com/LeaseWeb/LswMemcacheBundle, (*2)

Requirements

  • php 5.4
  • memcached 1.4 or higher
  • php-memcached 2.1 or higher

Installation

To install IslMemcachedBundle with Composer just add the following to your 'composer.json' file:, (*3)

{
    require: {
        "isl/memcached-bundle": "*",
        ...
    }
}

The next thing you should do is install the bundle by executing the following command:, (*4)

php composer.phar update isl/memcached-bundle

Finally, add the bundle to the registerBundles function of the AppKernel class in the 'app/AppKernel.php' file:, (*5)

public function registerBundles()
{
    $bundles = array(
        ...
        new Isl\MemcachedBundle\IslMemcachedBundle(),
        ...
    );

Install the following dependencies (in Debian based systems using 'apt'):, (*6)

apt-get install memcached php5-memcached

Do not forget to restart you web server after adding the Memcache module., (*7)

Configuration

Below you can see an example configuration for this bundle., (*8)

isl_memcached:
    pools:
        default:
            servers:
                - { host: 10.0.0.1, port: 11211, weight: 15 }
                - { host: 10.0.0.2, port: 11211, weight: 30 }
        pool2:
            servers:
                - { host: 10.0.0.3, port: 11211, weight: 15 }

Usage

$memcache = $this->get('isl.memcached')->getInstance('defaultpool', "persistentId optional");, (*9)

$memcache->set('foo', 'bar'); $memcache->get('foo');, (*10)

ADP: Anti Dog Pile

Based on: https://github.com/LeaseWeb/LswMemcacheBundle, (*11)

The methods are modified to work with memcached extension., (*12)

License

This bundle is under the MIT license., (*13)

The Versions

03/11 2016

dev-master

9999999-dev https://leibinger.io

Smyfony Bundle which provides integration for Memcached

  Sources   Download

MIT

The Requires

 

by Benjamin Leibinger

cache memcached