Scrapbook, PHP Caching Environment

// create \Memcached object pointing to your Memcached server
$client = new \Memcached();
$client->addServer('localhost', 11211);
// create Scrapbook cache object
$cache = new \MatthiasMullie\Scrapbook\Adapters\Memcached($client);

// set a value
$cache->set('key', 'value'); // returns true

// get a value
$cache->get('key'); // returns 'value'

Scrapbook is a caching environment for PHP. The cornerstone is key-value-store, which sets a standard interface for cache adapters to implement. All adapters hide their inner workings behind a shared implementation. Using it means you’re not just building for Memcached. Your code will work just fine on any of the other adapters, without modifications!

Ships with adapters for Memcached, Redis, APC, MySQL, SQLite, etc. Also plays nice with PSR-6 if needed

Scrapbook, PHP Caching Environment →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.