sFire PHP Framework

APCu cache adapter

sFire\Cache\Adapter\APCu is an adapter for sFire\Cache\Cache and is based on the PHP APCu library to store and retrieve data.

Note: APCu should be installed for this adapter to work properly.

In this section we will handle:

  • Setting the cache adapter
  • Usage

Setting the cache adapter

To set-up the cache adapter, you need to inject the adapter into a new instance of sFire\Cache\Cache. You can do so by injecting the adapter into the constructor, or by calling the setAdapter method.

Constructor
use sFire\Cache\Cache;

$cache = new Cache('APCu');
Set adapter
use sFire\Cache\Cache;

$cache = new Cache();
$cache -> setAdapter('APCu');

Usage

For the documentation about the usage of this adapter, you can view the sFire\Cache\Cache.