1. Go to this page and download the library: Download v3sp/v3cache 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/ */
v3sp / v3cache example snippets
use V3Cache\OpcacheManager\Opcache\NativeOpcacheApi;
use V3Cache\OpcacheManager\Service\OpcacheService;
$service = new OpcacheService(new NativeOpcacheApi());
$metrics = $service->getMetrics(); // V3Cache\OpcacheManager\Model\OpcacheMetrics
echo $metrics->hitRate; // e.g. 95.2 (%)
echo $metrics->memoryUsage; // e.g. 64.5 (MB)
echo $metrics->cachedScripts; // e.g. 1280