PHP code example of mtoolkit / mtoolkit-cache

1. Go to this page and download the library: Download mtoolkit/mtoolkit-cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mtoolkit / mtoolkit-cache example snippets


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

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

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