PHP code example of typhoon / opcache
1. Go to this page and download the library: Download typhoon/opcache 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/ */
typhoon / opcache example snippets
use Typhoon\OPcache\TyphoonOPcache;
$cache = new TyphoonOPcache('path/to/cache/dir');
$cache->set('key', $value);
assert($cache->get('key') == $value);
use Typhoon\OPcache\TyphoonOPcache;
$cache = new TyphoonOPcache(
directory: 'path/to/cache/dir',
defaultTtl: new DateInterval('T1M'),
);
use Typhoon\OPcache\TyphoonOPcache;
$cache = new TyphoonOPcache('path/to/cache/dir');
$cache->prune();