1. Go to this page and download the library: Download ihor/cachalot 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/ */
ihor / cachalot example snippets
// With Cachalot cache you can easily cache results of different types of functions
$cache = new \Cachalot\ArrayCache();
// built-in functions
$length = $cache->getCached('strlen', ['hello world']);
// user defined functions
$unique = $cache->getCached('uniqueValues', [[1, 2, 3, 1, 2, 3]]);
// static methods
$result = $cache->getCached(['Calculator', 'subtract'], [1, 2]);
// instance methods
$square = $cache->getCached([new Calculator(), 'square'], [5]);
// anonymous functions
$reason = $cache->getCached($getErrorReason, [], \Cachalot\Cache::ONE_DAY, 'error-reason');
// callable objects
$trimed = $cache->getCached(new Trimmer(), [' hello world ']);