1. Go to this page and download the library: Download radebatz/acache 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/ */
radebatz / acache example snippets
he = new Radebatz\ACache\ArrayCache();
$cache->save('yin', 'yang');
echo 'yin and '.$cache->fetch('yin');
e('MY_NAMESPACE', 'my');
$cache = new Radebatz\ACache\ArrayCache();
$cache->save('yin', 'yang', MY_NAMESPACE);
echo 'my yin and '.$cache->fetch('yin', MY_NAMESPACE).PHP_EOL;
e('MY_NAMESPACE', 'my');
$cache = new Radebatz\ACache\ArrayCache();
// wrap given cache in namespace
$myCache = new Radebatz\ACache\NamespaceCache($cache, MY_NAMESPACE);
$myCache->save('yin', 'yang');
echo 'my yin and '.$myCache->fetch('yin').PHP_EOL;
// or, using the decorated cache directly
echo 'my yin and '.$cache->fetch('yin', MY_NAMESPACE).PHP_EOL;
wo level cache stack
$cache = new Radebatz\ACache\MultiLevelCache(array(
new Radebatz\ACache\ArrayCache(),
new Radebatz\ACache\FilesystemCache(__DIR__.'/cache')
));
// save both in ArrayCache and FilesystemCache
$cache->save('yin', 'yang');
// lookup will only use ArrayCache
echo 'my yin and '.$cache->fetch('yin').PHP_EOL;
he = new Radebatz\ACache\MultiLevelCache(array(
new Radebatz\ACache\ArrayCache(),
new Radebatz\ACache\FilesystemCache(__DIR__.'/cache')
));
// save both in ArrayCache and FilesystemCache
//$cache->save('yin', 'yang');
// lookup will only use ArrayCache
echo 'my yin and '.$cache->fetch('yin').PHP_EOL;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.