PHP ClassesHow to Use Queue To Speedup PHP Processing Tasks Part 1: Queueing Slow Tasks (30.11.2015, 05:03 UTC)
By Alexander Skakunov
Queues are an important solution, especially when need to create a processing task that may take a long time to complete and the user or the creating process cannot wait until the task is finished.

This is the case for instance of sending newsletter email messages to many users.

Read this article to learn how queues work and how you can implement one in PHP using a simple database.
Ben RamseyYak Shaving Is the Entire Job Description (30.11.2015, 00:00 UTC)

Earlier this year, I worked on a solution to help us manage changes and history when maintaining different versions of Amazon Machine Images (AMIs). I entertained a wide range of ideas from Docker to AWS CloudFormation to a collection of shell scripts.

Finally, after asking in #pynash (Nashville’s Python user group) on Freenode IRC, Jason Myers pointed me to Packer as a potential solution.

Packer is a tool for creating machine and container images for multiple platforms from a single source configuration.

Packer turned out to be the right tool for the job, but I almost scrapped it, since I ran into a few problems.

When I began my journey as a programmer, every task was fraught with problems, and I loved it. Everything was new, and every problem was an opportunity to learn and grow. It was great.

Somewhere along the way, though, problems became nuisances. As I grew older in life and my career, my tolerance for problems became lower, and my desire for things to Just Work™ became greater.

As I struggled to find a solution for the problem I had with Packer, Tate Eskew reminded me that yak shaving is a part of my job.

<teskew> i'd just patch it, then. keep it in a central place so you only compile it once.
then when it's put into mainline, just switch out the binary
<teskew> either way, it's a pretty simple patch to test and change
<ramsey> ugh… gotta set up an environment just to build packer
<ramsey> "simple"
<teskew> you act like yak-shaving isn't the name of the game
<ramsey> :P
<teskew> hell, it's the entire job description
<teskew> :)
<ramsey> I am not an ops person
<teskew> you are right now :)

I ended up patching Packer for my needs, and I had fun doing it. I learned a valuable lesson that day: Despite how we may gripe and complain about shaving yaks, it’s part of our job as programmers and problem solvers, and often, it’s the part that brings us the most satisfaction. I’ve learned to embrace yak shaving, and doing so has changed my outlook on my job, open source contributions, and community organizing.

Yak shaving isn’t just part of our jobs, it’s the entire job description.

is a web craftsman, author, and speaker. He is a software architect at ShootProof, where he builds a platform for professional photographers. He enjoys organizing user groups and contributing to open source software. Ben blogs at and is @ramsey on Twitter.

“Yak Shaving Is the Entire Job Description” was originally published at and is Copyright © 2015 Ben Ramsey. It is licensed for use under a Creative Commons Attribution-ShareAlike license.

Liip PHP 7.0.0 (RC8) for OS X and CloudFoundry (28.11.2015, 08:38 UTC)

PHP 7.0 is very very near, if no showstoppers show up during the current Release Candidate #8. And I finally managed to update the package on, so that you can test and start writing applications on your local OS X machine easily, as well. The installer also automatically does the right thing in the apache configuration with regards to “mod_php7” and “mod_php5”.

Furthermore, since we are using CloudFoundry in one of our bigger projects, I also extended the official PHP buildpack to include PHP 7.0 (and some other things like varnish, but that’s not relevant for this). This way we can easily see, if our apps still work with PHP 7 and do some benchmarks (the initial ones looked promising). To use the buildpack, add the following line to your manifest.yml


and adjust .bp-config/options.json to include (and maybe also change your composer.json to use PHP 7)


Be aware, that I didn’t port many of the extensions the official buildpack includes, so your milage may vary. And if you want to be sure it’s thoroughly tested, maybe better wait for official PHP 7.0 support in the CloudFoundry buildpack. I’m sure, they won’t wait long once it’s is released.

There’s now no excuse anymore to not test your apps against PHP 7.0

SitePoint PHPModeling an Aggregate with Eloquent (27.11.2015, 17:00 UTC)

The Aggregate pattern is an important part of Domain Driven Design. It prevents inconsistencies and is responsible for enforcing business rules within a collection of objects. For these reasons alone, it is clear to see why it is a key component of a domain model.

Architectural advice recommends that the layer containing the Domain Model be independent from infrastructural concerns. While this is good advice, the Active Record pattern on the other hand wraps a row in the database. Because of this, it is almost impossible to decouple from the persistence layer.

Mixing persistence concerns into a Domain Model can become complex and lead to a lot of bad decisions. This does not mean that it is impossible to create an Active Record Domain Model. In this article, we will work through an example of building an Aggregate which also extends Eloquent: a popular Active Record ORM.

What is an Aggregate?

An Aggregate is a collection of objects which act as a single unit - with one of these objects acting as the Aggregate’s Root. Interaction from outside of the Aggregate must only communicate through the Root object. Aggregate Roots can then manage the consistency of all the objects within its boundary.

A set of elements joined into ></p> <p>Boundaries for Aggregates define the scope of a transaction. Before the transaction can be committed, manipulation to the cluster of objects must comply with the business rules. Only one Aggregate can be committed within a single transaction. Any changes required to additional Aggregates must be eventually consistent, happening within another transaction.</p> <p>In his book, <a href=Implementing Domain-Driven Design, Vaughn Vernon outlines a set of guidelines in which he calls: “the rules of Aggregate design”:

  1. Protect True Invariants in Consistency Boundaries
  2. Design Small Aggregates
  3. Reference Other Aggregates Only By Identity
  4. Use Eventual Consistency Outside the Consistency Boundary

Continue reading %Modeling an Aggregate with Eloquent%

Remi ColletForum PHP in Paris 2015 (27.11.2015, 13:15 UTC)

Back from Forum PHP Paris 2015.

First, a huge thanks to AFUP for the organization of this great event, as always, reception was beyond reproach.

This event was, once more, a great opportunity for many and rewarding meetings with lot of  PHP developers and users.

This year was exceptional, because PHP is 20 years old, AFUP is 15 years old and of course because of upcoming  PHP version 7:


On the photo : (top) Derick Rethans, Anatol Belski, me, Zeev Suraski, (bottom) Pierre Joye, Rasmus Lerdorf, Bob Weinand and Nikita Popov.

More photos on Flickr.

I had the change to give a talk about collaboration between upstream (projects) and downstream (distribution) with an important part about QA management by the Fedora project.

Read the slides: Paris2015.pdf.

Feedback seems good, see

I waiting for next meetings.

Lorna MitchellGenerating a File List for Phan (27.11.2015, 09:31 UTC)

Phan is the PHP Analyzer for PHP 7 code. I've been using it, partly out of curiosity, and partly to look at what the implications of upgrading my various projects will be. The simplest usage instructions are:

phan -f filelist.txt

I generated my filelist.txt files with a little help from grep - by looking for all files with opening PHP tags in, and putting that list of filenames into a file. My command looks like this:

grep -R -l "<?php" * > filelist.txt

This simply greps recursively (the -R switch) in all files looking for <?php and when it finds it, outputs only the filename (the -l switch does that bit). Then I just put all the output into my filelist.txt file.

Phan is in its early stages but it's ready for you to run on your own projects. Look out that you may need to put your bootstrap or other include files first in the filelist.txt file if phan isn't finding things in the right order - luckily with it all in one file, it's relatively easy to move things around if you need to.

Generating a File List for Phan was originally published on LornaJane by Lorna. Lorna is a web development consultant, tech lead, author, trainer, and open source maintainer, and she is occasionally available for freelance work.

Cal Evans (Voices of the ElePHPant) Interview with Brian Fenton (27.11.2015, 05:00 UTC) Link
Ben RamseyLack of Hypermedia (27.11.2015, 00:00 UTC)

Justin Rohrman, a former co-worker of mine, recently posted “6 Reasons Your API is the Windows Vista of APIs.” For his article, he asked me:

I was wondering if you might give me a short description of what you see as one of the biggest API problems?

I thought it might be helpful to post my full response, which follows:

One of the most common problems I see in API development is lack of hypermedia, or none at all. By hypermedia, I mean links that describe relationships among data in the API. When hypermedia isn’t used, the API becomes brittle, and those building clients that talk to the API are forced to code to URLs. The URLs become an important interface to the API, and if they change, they break everything. This leads to URL-based versioning schemes, and the only upgrade path for clients is to modify their code to accommodate the new versions.

When an API uses hypermedia, the URLs are no longer important. Clients talking to the API do not need to code to URLs because the API will always convey where to go next through hypermedia relationships. If a URL changes, then there’s no problem. The change gets communicated through the API. This leads to a more flexible and evolvable API that can change over time without needing to update all the clients.

I gave a talk at True North PHP this year that covered this topic. The slides are available for download.

is a web craftsman, author, and speaker. He is a software architect at ShootProof, where he builds a platform for professional photographers. He enjoys organizing user groups and contributing to open source software. Ben blogs at and is @ramsey on Twitter.

“Lack of Hypermedia” was originally published at and is Copyright © 2015 Ben Ramsey. It is licensed for use under a Creative Commons Attribution-ShareAlike license.

PHP ClassesPHP Articles and Book Reviews Report November 2015 Edition (26.11.2015, 05:09 UTC)
By Manuel Lemos
This is the November edition of the podcast hangout recorded by Manuel Lemos and Arturs Sosins to comment on the latest outstanding PHP Articles and Book Reviews published recently.

They commented on articles about creating Microsoft Word DOCX documents from HTML, PHP 7 Anonymous classes and nested classes, tracking accesses to your site API using Google Analytics, and reading and writing Microsoft Excel files using PHP stream handlers.

They also commented on the review of the Hack and HHVM book.

Listen to the podcast, or watch the hangout video to learn more about these PHP articles and book reviews.
PHP: Hypertext PreprocessorPHP 5.6.16 is available (26.11.2015, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 5.6.16. Several bugs have been fixed. All PHP 5.6 users are encouraged to upgrade to this version. For source downloads of PHP 5.6.16 please visit our downloads page, Windows binaries can be found on The list of changes is recorded in the ChangeLog.
LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP