PHP code example of itrnka / ha-apcu-middleware
1. Go to this page and download the library: Download itrnka/ha-apcu-middleware 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/ */
itrnka / ha-apcu-middleware example snippets
$cfg['middleware'] = [
// ...
// APCu cahce
[
ha\Middleware\Cache\APCu\APCu::class,
[
'name' => 'apc',
'keyPrefix' => 'someUniqueKeyForAppInYourMachine',
'defaultTTL' => 0,
]
],
// ...
];
// middleware instance
$apc = main()->middleware->apc;
// example call:
$value = main()->middleware->apc->get('myValue', null);