-
-
Notifications
You must be signed in to change notification settings - Fork 453
[V6˖] Psr16 adapter
Georges.L edited this page Feb 23, 2022
·
4 revisions
As of the V6 an helper is now available to allow you to make use of the Psr16 adapter.
/**
* @author Khoa Bui (khoaofgod) <[email protected]> http://www.phpfastcache.com
* @author Georges.L (Geolim4) <[email protected]>
*/
use phpFastCache\Helper\Psr16Adapter;
chdir(__DIR__);
require_once __DIR__ . '/../vendor/autoload.php';
$defaultDriver = (!empty($argv[1]) ? ucfirst($argv[1]) : 'Files');
$Psr16Adapter = new Psr16Adapter($defaultDriver, [/* Config array */]);
if(!$Psr16Adapter->has('test-key')){
$nastyStuff = 'Database/webservice/etc operations';
$Psr16Adapter->set('test-key', $nastyStuff);
}else{
$value = $Psr16Adapter->get('test-key');
}
❓ Finally, if you need help, always check out the inevitable README.md