Skip to content
Easiest way to remember things across requests in PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Remember
tests
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

Remember

Easiest way to remember things across requests in PHP.

Motivation

I love generating code and I needed a way of rebuilding only if something changed.

How it works

use Remember\Remember;

$function = Remember::wrap('name', function(Array $args, Array $files) {
    // do some that is expensive
    return $result;
});

// It will calculate once and cache the result
// until __FILE__ changes.
$result = $function([__FILE__, 'foobar']);

Low level API

use Remember\Remember;

$ns = Remember::ns('foobar');
$result = $ns->get([__FILE__], $isValid);
if (!$isValid) {
    // do something
    $result = ...;
    $ns->store([__FILE__], $result);
}
You can’t perform that action at this time.