1. Go to this page and download the library: Download benjamindean/one-line-apc 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/ */
class ReturnData {
public function fetchData($url) {
return file_get_contents($url);
}
}
$obj = new ReturnData();
$apc = new OneLineAPC();
$apc->setTtl(3600);
return $apc->cached('key', array($obj, 'fetchData'), array('http://example.com/'));
function fetchData($url) {
return file_get_contents($url);
}
$apc = new OneLineAPC();
$apc->setTtl(3600);
return $apc->cached('key', 'fetchData', array('http://example.com/'));
$something = 'Data to be cached';
$apc = new OneLineAPC();
return $apc->cached('key', $something, false, 3600);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.