2017 © Pedro Peláez
 

symfony-bundle apcu-bundle

Provide APCu support

image

m6web/apcu-bundle

Provide APCu support

  • Monday, February 27, 2017
  • by M6Web
  • Repository
  • 25 Watchers
  • 2 Stars
  • 51,825 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

Bundle APCu Build Status Total Downloads License PHP Version Require

Provide APCu support, see PECL/APCu., (*1)

Installation

Via Composer :, (*2)

"require": {
    "m6web/apcu-bundle" : "^1.4"
}

Also require the PECL extension APCu :, (*3)

# pecl install -f apcu

Don't forget to enable the extension in your php.ini., (*4)

NB: due to an update in APCu API, from ApcuBundle v1.1.1, you must install APCu v4.0.7 or higher, (*5)

Configuration

The main configuration key is m6web_apcu. Each subkey defines a new Apcu cache service. These services are named m6web_apcu + subkey. For each service, several parameters can be set :, (*6)

  • namespace (string, optional) : Empty by default. Namespace for all keys stored in APCu cache via this instance.
  • ttl (integer, optionnal) : 3600 (seconds) by default. Define the default TTL used when no TTL is given to store data.
  • class (string, optionnal) : You can override the default cache class. It should extends M6Web\Bundle\ApcuBundle\Apcu\Apcu.

Example

m6web_apcu:
    myCache:
        namespace: 6play-api-applaunch
        ttl: 3600
    otherCache: ~

Usage

$cache = $container->get('m6web_apcu.myCache');
$key   = 'myCacheKey';

var_dump($cache->exists($key)); // boolean, false

$cache->store($key, 'Hello', 3600)

var_dump($cache->exists($key)); // boolean, true
var_dump($cache->fetch($key)); // string, Hello

$cache->delete($key);

var_dump($cache->exists($key)); // boolean, false
var_dump($cache->fetch($key)); // bolean, false

Tests

If you wish to run Bundle tests, you must enable APCu in CLI environment by defining apc.enable_cli option to 1., (*7)

Then you can run the tests :, (*8)

$ ./vendor/bin/phpunit tests

The Versions

27/02 2017

dev-master

9999999-dev

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu >=4.0.7, <5.3

 

The Development Requires

06/04 2016

v1.4.0

1.4.0.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu >=4.0.7, <5.2

 

The Development Requires

22/12 2015

v1.3.0

1.3.0.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu >=4.0.7, <5.2

 

The Development Requires

22/12 2015

v1.3.1

1.3.1.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu >=4.0.7, <5.2

 

The Development Requires

04/12 2015

v1.2.1

1.2.1.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu ~4.0.7

 

The Development Requires

09/09 2015

v1.2.0

1.2.0.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu ~4.0.7

 

The Development Requires

05/12 2014

v1.1.1

1.1.1.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu ~4.0.7

 

The Development Requires

05/12 2014

v1.1.0

1.1.0.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu >=4.0,<4.0.7

 

The Development Requires

28/04 2014

v1.0.1

1.0.1.0

Provide APCu support

  Sources   Download

The Requires

  • php >=5.5
  • ext-apcu ~4.0

 

The Development Requires