1. Go to this page and download the library: Download originphp/cache 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/ */
originphp / cache example snippets
Cache::config('default', [
'engine' => 'File',
'duration' => '+60 minutes', // string or number of seconds e.g. 3600,
'prefix' => 'cache_'
'serialize' => true // set to false if you going to cache strings such as output
'path' => dirname(__DIR__) . '/cache'
]);
Use Origin\Cache\Cache;
$success = Cache::write('key',$value);
Use Origin\Cache\Cache;
$value = Cache::read('key');
Use Origin\Cache\Cache;
if(Cache::exists('key')){
$bool = Cache::read('key');
}
Cache::config('default', [
'engine' => 'File',
'duration' => '+60 minutes', // string or number of seconds e.g. 3600,
'prefix' => 'cache_'
'serialize' => true // set to false if you going to cache strings such as output,
'mode' => 0664
]);
Cache::config('default', [
'engine' => 'Apcu',
'duration' => '+60 minutes', // string or number of seconds e.g. 3600,
'prefix' => 'cache_'
]);
Cache::config('default', [
'engine' => 'Memcached',
'host' => '127.0.0.1',
'port' => '11211',
'duration' => '+60 minutes', // string or number of seconds e.g. 3600,
'prefix' => 'cache_'
]);