design-patterns

  • Rebuilding an internal admin panel on Laravel 4

    A framework four months old, an admin panel five years old, and one small section of it rebuilt to find out what Laravel 4 is like to live…

  • A front controller is the routing you already wrote by hand

    A site built as products.php, basket.php and checkout.php carries the same fifteen lines at the top of every file: session start, config include, database connection, a login check.…

  • A front controller is one entry point and a router

    An application with a PHP file per page has its bootstrap copied into every one of them — session start, config include, database connection, the auth check somebody…

  • Introducing Composer to a CodeIgniter application

    Four unversioned libraries in application/libraries, two of them edited in place. Moving the application onto Composer and PSR-0 without giving up the framework’s own loader.

  • Traits close the gap that interfaces left open

    Two classes that need the same six lines and share no useful ancestor have left three options for as long as PHP has had objects: copy the lines,…