PHP code example of bnomei / kirby3-mysql-cachedriver

1. Go to this page and download the library: Download bnomei/kirby3-mysql-cachedriver 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/ */

    

bnomei / kirby3-mysql-cachedriver example snippets


$cache = \Bnomei\MySQLCache::singleton(); // or
$cache = dolphin();

$cache->set('key', 'value', $expireInMinutes);
$value = dolphin()->get('key', $default);

dolphin()->remove('key');
dolphin()->flush();

dolphin()->benchmark(1000);


return [
    'bnomei.lapse.cache' => ['type' => 'mysql'],
    'bnomei.boost.cache' => ['type' => 'mysql'],
    //... other options
];

return [
    // other config settings ...
    'bnomei.mysql-cachedriver.dbname' => 'YOUR-DBNAME-HERE',
    'bnomei.mysql-cachedriver.username' => 'YOUR-USERNAME-HERE',
    'bnomei.mysql-cachedriver.password' => 'YOUR-PASSWORD-HERE',
];

return [
    // other config settings ...
    'bnomei.mysql-cachedriver.dbname' => function() { return env('MYSQL_DBNAME'); },
    'bnomei.mysql-cachedriver.username' => function() { return env('MYSQL_USERNAME'); },
    'bnomei.mysql-cachedriver.password' => function() { return env('MYSQL_PASSWORD'); },
];