1. Go to this page and download the library: Download phlak/stash 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/ */
// Cache a value for 15 minutes
$stash->put('foo', 'some value', 15);
// Cache a value indefinitely
$stash->put('bar', false);
$stash->forever('foo', 'some value');
$stash->get('foo');
// Return 'default' if 'bar' doesn't exist
$stash->get('bar', 'default');
$stash->has('foo');
$stash->remember('foo', 60, function() {
return new FooClass();
});
$stash->rememberForever('pokemon', function() {
return new Pokemon($name, $description);
});
// Increment by 1
$stash->increment('foo');
// Increment by 10
$stash->increment('bar', 10);
// Decrements by 1
$stash->decrement('foo');
// Decrements by 10
$stash->decrement('bar', 10);
// Extend the expiration by 5 minutes
$stash->touch('foo', 5);
// Extend the expiration indefinitely
$stash->touch('bar');
// Extend the expiration of multiple items by 5 minutes
$stash->touch(['foo', 'bar', 'baz'], 5);
$stash->forget('foo');
$stash->flush();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.