Skip to main content

Class ShmopCacheEngine

This class uses the PHP Shmop as the cache engine.

The Shared memory allows multiple processes to access the same data in memory. You can use it to share data among running PHP scripts in the same server.


These are the default values for the configuration:

$config = [
'max-size' => 524288, // 512Kb
'default-permission' = > '0700',

PSR-16 Constructor

$cache = new \ByJG\Cache\Psr16\ShmopCacheEngine($config, $prefix)

PSR-6 Constructor

$cachePool = \ByJG\Cache\Factory::createSessionPool($prefix, $bufferSize = 10)


$cachePool = new \ByJG\Cache\Psr6\CachePool(new \ByJG\Cache\Psr16\ShmopCacheEngine($config, $prefix));