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 […]

Carbon – A simple PHP API extension for DateTime.

$carbon = new Carbon(‘first day of next week’); if ($carbon->isWeekend()) { echo ‘Party!’; } echo $carbon->addYear()->diffForHumans(); // ‘in 1 year’ Carbon is just a class which is designed to be used instead of DateTime. Due to extending DateTime, all DateTime methods are available to users of Carbon. Additionally, it implements a __toString method, allowing users […]

PHP Markdown

use \Michelf\Markdown; $my_html = Markdown::defaultTransform($my_text); This is a library package that includes the PHP Markdown parser and its sibling PHP Markdown Extra with additional features. Originally it was a port to PHP of the Markdown tool written by John Gruber. Here’s how to get it via Composer: composer require michelf/php-markdown PHP Markdown →

Extract Till You Drop

Under the pressure of deadlines and endless change requests, under the weight of years of legacy, code becomes unmaintainable. With the right tools, techniques, and mindset, any codebase can be brought under test, and be refactored towards a better architecture. Let’s skip the theory and dive straight into the spaghetti code. In a live coding […]