PHP code example of nazo / safeapc

1. Go to this page and download the library: Download nazo/safeapc 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/ */

    

nazo / safeapc example snippets



use SafeApc;

// initialize
$apc = new SafeApc();
$apc->setCacheStartTime($_SERVER['REQUEST_TIME']);
$apc->setCacheVersionKey(file_get_contents('apc_version'));


// set key
$apc->set('cache key', $value, 100);

// get key (throws SafeApcNotFoundException)
$apc->get('cache key');

// delete key
$apc->delete('cache key');