Skip to content

Instantly share code, notes, and snippets.

Last active Sep 10, 2018
What would you like to do?
A singleton application cache
class LocalCache {
use Singleton;
protected store = [];
public function get($key, default = null) {
return isset($this->store[$key])) ? $this->store[$key] : $default;
public function set($key, $value) {
$this->store[$key] = $value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment