1. Go to this page and download the library: Download ez-php/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/ */
$cache->increment('page-views'); // 1
$cache->increment('page-views', 5); // 6
$cache->decrement('stock:sku-42', 2); // creates the key at 0 if absent, then subtracts
$tagged = $cache->tags('users');
$tagged->set('profile:42', $profile, 300);
$tagged->flush(); // invalidates all keys tagged with 'users'
use EzPhp\Cache\StampedeProtectedCache;
$protected = new StampedeProtectedCache($cache);
$value = $protected->remember('expensive-key', 300, fn () => heavyQuery());
use EzPhp\Cache\PrefixedCache;
$tenant = new PrefixedCache($cache, 'tenant-42:');
$tenant->set('settings', [...]); // stored as tenant-42:settings
$tenant->tags('users')->flush(); // only this tenant's tagged entries
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.