1. Go to this page and download the library: Download joefallon/phpcache 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/ */
use JoeFallon\Cache\ApcCache;
use JoeFallon\Cache\TaggedCache;
$cache = new TaggedCache(new ApcCache()); // use default namespace and expires
$key1 = 'key1';
$value1 = 'value1';
$cache->store($key1, $value1);
$key1Exists = $cache->exists($key1);
$value = null;
if($key1Exists)
{
$value = $cache->retrieve($key1);
}
else
{
$value = expensiveMethod();
}
use JoeFallon\Cache\ApcCache;
use JoeFallon\Cache\TaggedCache;
$cache = new TaggedCache(new ApcCache()); // use default namespace and expires
$key1 = 'key1';
$value1 = 'value1';
$cache->store($key1, $value1, array('tag1', 'tag2'));
$cache->removeByTag('tag2'); // the cache entry for 'key1' is deleted
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.