PHP code example of netherphp / cache
1. Go to this page and download the library: Download netherphp/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/ */
netherphp / cache example snippets
$Manager = new Nether\Cache\Manager;
$Manager
->EngineAdd(new Nether\Cache\Engines\LocalEngine)
->EngineAdd(new Nether\Cache\Engines\MemcacheEngine(
Servers: [ 'localhost:11211' ]
))
->EngineAdd(new Nether\Cache\Engines\FilesystemEngine(
Path: '/where/ever'
));
$Manager->Set('unique-id','value');
var_dump(
$Manager->Has('unique-id'),
$Manager->Get('unique-id')
);
// bool(true)
// string(5) "value"
$Manager->Drop('unique-id');
var_dump(
$Manager->Has('unique-id'),
$Manager->Get('unique-id')
);
// bool(false)
// NULL
$Manager->Set('test', 'geordi', Origin:'engineering');
print_r($Manager->GetCacheObject('unique-id'));
new Nether\Cache\Engines\LocalEngine(
UseGlobal: bool
);
new Nether\Cache\Engines\MemcacheEngine(
UseGlobal: bool,
Memcache: Memcache|null
);
new Nether\Cache\Engines\FilesystemEngine(
Path: string,
UseHashType: string|NULL,
UseHashStruct: bool
UseFullDrop: bool
);