PHP Annotated Monthly – July 2016

PHP Annotated Monthly Logo

July is here already, and it’s time for Gary Hockin to stop promoting PhpStorm 2016.2 </plug> and round up the interesting articles in the PHP community.

PHP

Another month, another round of releases:

Here’s a scary thing. As I write this on July 11th, PHP 5.5 has gone to end of life. Let’s read that again; PHP 5.5 no longer gets active support, NOT EVEN security patches. Only PHP 7.0 and 5.6 are currently supported. Now is the best time ever to upgrade to PHP 7 (no excuses!).

Interestingly this month, PHP 7.1 has gone to alpha 3 and is available to try.

Creating sample data to test your application is hard, but over on the PHP Builder website is an absorbing article – Programmatically Create Sample Testing Data in PHP which explains how to create valid sample data using a tool called Faker.

SitePoint (we’ll hear a lot from them this month) posted a fantastic article on PHP, Arduino and Minecraft? Combining Minecraft with PHP! by Chris Pitt. I saw Chris give a unique and enjoyable talk on Minecraft at php[tek] where he delivered the entire talk from within Minecraft, and this article is equally as interesting. SitePoint also posted a cool talk about Do PHP and IoT Have a Future Together? which investigates if PHP has a place controlling stuff in the scary future Internet of Things.

Composer and Packagist overlord Jordi Boggiano investigated if Typo Squatting and Packagist is a viable attack vector for compromising PHP applications, and if it’s happening. I won’t give away the ending, you’ll have to read the post to find out.

File uploads suck. There are so many things to go wrong, but Chris White’s blogged a really nice idea in Avoiding the burden of file uploads. Chris investigates using an S3 bucket and some cool code to upload files that don’t get stored on your web server. I also really enjoyed Writing good code: how to reduce the cognitive load of your code this month, written by Christian M. Mackeprang, I found the advice interesting and useful.

Back to SitePoint, they’ve blogged on The PHP Application Environment, which explains the different environments your application may run on. It’s part of a free ebook, and if the book is as good as the article, it’s worth checking out. They also blogged on creating Your Own Custom Annotations:€“ More than Just Comments! which explains how you can set up and parse your own annotations in (and outside) a Symfony Project. SitePoint are quickly becoming the de-facto place to find quality content for PHP, a big “thank you!” to them.

Frameworks and Tools

Hot news in Zend Framework land, with the announcement of Zend Framework 3’s release last week. Congratulations to everyone who contributed to this incredible achievement. ZF3 is not a huge upgrade path from ZF2 (unlike ZF1 to ZF2), but gives extensive maintenance and performance wins – it’s worth checking out.

On the flipside, Zend also announced that it will be finishing its support for Zend Framework 1 in 3 months time. Zend Framework 1 has had a good run; indeed, it’s the framework that got me introduced to OOP and the PHP community as a whole so it’s a sad day for many. So long good buddy.

Staying with Zend Framework (no bias intended – sorry!), Using ServiceManager 3 lazy services to improve your PHP application performance is a very valid and valuable example of how the new ZF3 Service Manager can help to improve your application performance.

The ever productive Matt Stauffer blogged on The new cache() global helper in Laravel 5.3 which helps you cache items from all over your application. Matt’s book on Laravel is due to be released soon (I’m lucky enough to have seen a preview), and I highly recommend it if you are looking to get into Laravel.

Disco with Design Patterns: A Fresh Look at Dependency Injection on the SitePoint blog describes how you can use a new an interesting DI container called Disco to manage dependencies in your application. I really need to take a look at Disco soon, it seems absorbing. Rob Allen revisited his blog post on using Doctrine Migrations outside of a framework in Standalone Doctrine Migrations redux.

On the Symfony blog, they introduced a new form type for handling dates and times in New in Symfony 3.2: DateInterval form type. Forms are hard, dates are hard, and forms that handle dates are hard², so any help we can get is very much appreciated. TutsPlus.com started a series on WordPress with Internationalizing WordPress Projects: The Introduction and Using PHP CodeSniffer With WordPress: Installing and Using PHP CodeSniffer. Internationalization is also hard, so this looks to be a very useful series.

Richard Bagshaw took time out from abusing me on Twitter to blog on the  Prophecy mocking tool. Richard investigates using Prophecy instead of Mockery as his mocking framework of choice, a fascinating read.

Liip blogged on Let’€™s debug in Drupal 8 ! which examines the different methods of debugging a Drupal application. It doesn’t mention PhpStorm’s extraordinary step debugging tools </plug> but does do an excellent job of explaining the various ways to debug the different areas of a Drupal 8 App.

Community (and more)

Stefan Koopmanschap blogged on The Speaker Package, a post that will ring true with many speakers, outlining how hard it is for many speakers to afford to speak when the speaker package is not that impressive.

Podcasting has been so-so this month:

I’m hoping to revamp the format somewhat next month, but given I will be sitting in a campsite in the Loire Valley in France as I write, what you actually might get is a bullet list of links and drunken ramblings as I try to compose this post while drinking high-quality Crémant de Loire.

As usual, if there are any posts you’d like me to feature here next month, please get in touch.

– Gary and the PhpStorm Team

image description