2017 © Pedro Peláez
 

symfony-bundle cache-bundle

Symfony LeaptCacheBundle

image

leapt/cache-bundle

Symfony LeaptCacheBundle

  • Monday, December 4, 2017
  • by leapt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 171 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 20 % Grown

The README.md

Introduction

This bundle is used to provide access to cache drivers., (*1)

This is a work in progress with two drivers: Memcached and APC., (*2)

Installation

  1. Add this bundle to your vendor/ dir:, (*3)

    Add the following line in your composer.json file:, (*4)

    "leapt/cache-bundle": "~1.0",

    Run composer:, (*5)

    composer update leapt/cache-bundle
  2. Add this bundle to your application's kernel:, (*6)

    // app/ApplicationKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new Leapt\CacheBundle\LeaptCacheBundle(),
            // ...
        );
    }
  3. Add the configuration in your config.yml file, (*7)

    leapt_cache:
        namespace: yournamespace
        caches:
            tweets:
                type: memcached
                options:
                    server: localhost
                    port: 11211
                    ttl: 86400
            flickr:
                type: memcached
                options:
                    server: localhost
                    port: 11211
                    ttl: 45632

Usage

    $cacheManager = $this->get('leapt_cache.manager');

    $cache = $cacheManager->getCache('tweets');

    if ($cache->isEnabled()) {
        if (false === $tweets = $cache->get('tweets')) {
            $tweets = $this->getTweets();
            $cache->set('tweets', $tweets);
        }
    } else {
        $tweets = $this->getTweets();
    }

Running the tests

Before running the tests, you will need to install the bundle dependencies. Do it using composer :, (*8)

curl -s http://getcomposer.org/installer | php
php composer.phar --dev install

Then you can simply launch phpunit, (*9)

phpunit

The Versions

04/12 2017

dev-master

9999999-dev https://github.com/leapt/cache-bundle

Symfony LeaptCacheBundle

  Sources   Download

MIT

The Requires

 

by Jérôme Poskin
by Pierre Vanliefland
by Edwin Hermans

cache

04/12 2017

v2.0.0

2.0.0.0 https://github.com/leapt/cache-bundle

Symfony LeaptCacheBundle

  Sources   Download

MIT

The Requires

 

by Jérôme Poskin
by Pierre Vanliefland
by Edwin Hermans

cache

13/06 2016

v1.0.1

1.0.1.0 https://github.com/leapt/cache-bundle

Symfony LeaptCacheBundle

  Sources   Download

MIT

The Requires

 

by Jérôme Poskin
by Pierre Vanliefland
by Edwin Hermans

cache

28/08 2015

v1.0.0

1.0.0.0 https://github.com/leapt/cache-bundle

Symfony LeaptCacheBundle

  Sources   Download

MIT

The Requires

 

by Jérôme Poskin
by Pierre Vanliefland
by Edwin Hermans

cache