Community News: Packagist Latest Releases for 11.22.2014

Recent releases from the Packagist:

PHPDeveloper.org

Voices of the ElePHPant: Interview with Mike van Riel

The Voices of the ElePHPant podcast has released their latest episode in their community interview series. In this latest episode host Cal Evans talks with Mike van Riel, the project lead on the PHP Documentor project.

Cal and Mike talk about Mike’s work in a community-focused company, his own experience at the WeCamp conference, his experience speaking and the work he does on the PHP Documentor project.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you enjoy the interview and want to hear more from the PHP community, be sure to subscribe to their feed.

Link: http://voicesoftheelephpant.com/2014/11/18/interview-with-mike-van-riel/
PHPDeveloper.org

SitePoint PHP Blog: Practical OOP: Building a Quiz App – Bootstrapping

The SitePoint PHP blog has kicked off a new series of posts today with the first tutorial about building an application with OOP and the Slim framework. In this starting article they focus in on bootstrapping the application and introducing some of the basics behind MVC and OOP.

At a certain point of my development as a PHP programmer, I was building MVC applications by-the-book, without understanding the ins-and-outs. I did what I was told: fat model, thin controller. Don’t put logic in your views. What I didn’t understand was how to create a cohesive application structure that allowed me to express my business ideas as maintainable code, nor did I understand how to really separate my concerns into tight layers without leaking low-level logic into higher layers. I’d heard about SOLID principles, but applying them to a web app was a mystery. In this series, we’ll build a quiz application using these concepts. We’ll separate the application into layers, allowing us to substitute components: for example, it’ll be a breeze to switch from MongoDB to MySQL, or from a web interface to a command-line interface.

They start off with a bit about why „MVC is not enough“ and how they’ll be applying domain modeling as a part of the application. There’s also a brief mention of the concept of a service layer and how it will fit into the overall structure. Then it’s on to the code: getting Slim installed (via Composer) and starting in on the interface/service classes for the Quiz. They walk you through entity creation for the Quiz and Question instances and a mapper to tie them together.

Link: http://www.sitepoint.com/practical-oop-building-quiz-app-bootstrapping/
PHPDeveloper.org

Liip Blog: Functional Programming in PHP

On the Liip blog today there’s a tutorial from Gilles Crettenand giving you an overview of functional programming in PHP. While PHP is not normally used as a functional language, it is possible to simulate the same effect.

Functional programming has gained a lot of traction those 3 to 5 last years. […] Those [frameworks and languages] are all cool and shiny new toys, but we can benefit from some techniques without having to learn a new tool, just by applying some principles to our everyday PHP! But first of all, what exactly is functional programing?

He starts off with some of the basics of functional programming, some of the difficulties that can come with it and, of course, the advantages it can provide. From here he starts in with code examples. He shows how functions become „first-class citizens“ and how they can be applied to various elements. He illustrates this with a few array manipulation examples. Next up are „utility functions“ for evaluating the data given (like „any“ or „all“). He ends the post looking at the idea of „memoization“, or the caching of the results of function calls against data. He shows how to accomplish this with static local variables in PHP and includes a wrapper you can pass any callable function into and have the results cache automatically.

Link: http://blog.liip.ch/archive/2014/11/05/functional-programing-in-php.html
PHPDeveloper.org