mtoolkit/mtoolkit-cache

The cache module of MToolkit framework

0.0.2 2016-06-01 15:55 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:33:10 UTC


README

The cache module of MToolkit framework.

Cache types

  • MySQL
  • File
  • APC

Usages

Following, the examples of each type of supported cache.

MySQL

$cacheManager = MCacheFactoryImpl::getManager(new MCacheConfiguration(
    MCacheType::MYSQL,
    array(
        'db' => new PDO(...),
        'table' => 'mcache'
    )
));

File

$cacheManager = MCacheFactoryImpl::getManager(new MCacheConfiguration(
    MCacheType::FILE,
    array(
        'path' => '/temp/cache'
    )
));

APC

$cacheManager = MCacheFactoryImpl::getManager(new MCacheConfiguration(
    MCacheType::APC,
    array()
));