1. Go to this page and download the library: Download highperapp/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/ */
highperapp / cache example snippets
use HighPerApp\Cache\ServiceProvider;
// Auto-configure from environment
$cache = ServiceProvider::createFromEnv();
// Or configure manually
$cache = ServiceProvider::createWithConfig([
'engine' => 'auto',
'default_store' => 'redis',
'redis' => [
'host' => '127.0.0.1',
'port' => 6379
]
]);
// Store data
yield $cache->set('user:123', ['name' => 'John', 'email' => '[email protected]'], 3600);
// Retrieve data
$user = yield $cache->get('user:123');
// Check if exists
$exists = yield $cache->has('user:123');
// Delete data
yield $cache->delete('user:123');
// Auto-select best available engine
$cache = ServiceProvider::createFromEnv();
// Force specific engine
$cache = ServiceProvider::createWithConfig([
'engine' => 'rust_ffi' // or 'amphp', 'pure_php'
]);
// Store with tags
yield $cache->setWithTags('product:123', $product, ['products', 'catalog'], 3600);
// Invalidate by tag
yield $cache->invalidateByTag('products');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.