Subscribe! Enter your email address below:

NO SPAM: We absolutely hate spam. We will not share, rent, or give away your email address to anyone.You can unsubscribe at any time. Easily!

September 21, 2017

Welcome to the latest @phpweekly news.

The second release candidate for PHP 7.2.0 has been announced this week, ready for testing.

After the success of last years Laravel Survey, the team has brought it back for 2017. With results available in a few weeks, take five minutes to submit your feedback.

Also this week, we take a look at the top security tips to keep hackers out of your WordPress site.

Plus we learn how to create a custom table in WordPress, and an upgrade routine.

And finally, episode 2 of the php[architect] podcast is out now, discussing how to manage changes in your application and your career.

Have a great weekend, 

Katie and Ade

Please help us by clicking to our sponsor:

encrypt php scripts 
Protect your PHP Code
Why not try SourceGuardian 11. Click here to download a 14 Day Trial copy. Protect your code using Windows, Linux or Mac and run everywhere with our free Loaders.


The One With All The Multitasking
Time management is by itself problematic for me, as I am not the most organised person - to put it mildly. Add further complications that arise with alternating between several projects simultaneously, and there’s a delicious recipe for panic, if you ask me. Nonetheless, there is hope in this grim world of multitasking! And in this article I will attempt to convey how I managed to overcome mayhem and achieve an auspicious state of tranquility. So let’s cut right to it, shall we?

Create A Restful API With These Lightweight PHP Frameworks
It’s always a great idea to make use of a lightweight PHP framework especially while developing a REST API. A framework is PHP language can be considered as a true means to enhance productivity to deliver faster results without deviating from best standards and practices. In the following post, I would like to mention some of the best lightweight PHP frameworks used for rest APIs development…

XAMPP vs MAMP vs Local vs DesktopServer: A Comparison Guide to Local Dev Environments
An easy-to-use local testing server is one of the most important tools in a WordPress developer’s utility belt1. Developing in a local environment lets you make changes to dev sites quickly and easily without having to transfer files anywhere and greatly reduces the risk of making breaking changes on a live server.

A “Systems” Addendum To Semantic Versioning
Semantic Versioning concentrates on the public API signature as the determiner of when to change version numbers. If the public API changes in a backwards-incompatible way, then you have bump the major version number. When I upgrade a dependency to a minor or patch version, I am hypothetically assured that the upgrade will be successfully completed, and that I will not have to change anything about my existing system or codebase.

The PhpStorm Plugins of My Choice
Earlier last week I found a github repository which collects different resources related with PhpStorm. Plugins, themes, utilities... I found it very interesting, because I think PhpStorm is the best PHP IDE by far, and I've been using it on an almost daily basis for the last 4 years. The thing is that finding that repository gave me the idea of writing a post explaining the list of third party plugins I use and why, in case somebody is starting to use the IDE and wants some ideas on where to start. If you want to get any of them, just search for it inside PhpStorm. It's the easiest way to install them.

The Future of HHVM
Several months ago, PHP officially announced the end-of-life for PHP5. The HHVM team is happy about the direction PHP has taken with PHP7, and we’re proud of the role we’ve played in pushing the language and runtime to where they are today. Since the PHP community is finally saying goodbye to PHP5, we’ve decided to do so as well.

Tutorials and Talks

Creating a Custom Table with PHP in WordPress
Have you ever wondered what it takes to create a custom table in WordPress or why you would ever want or need to? WordPress comes with many different ways to store data out-of-the-box. Luckily for us, WordPress is flexible enough that we aren’t forced to shoehorn our every need into the ready-made solutions that come with it. In this article, we’ll walk through the process of creating a custom table, as well as an upgrade routine to boot.

Symfony Console Beyond the Basics – Helpers and Other Tools
It’s undeniable how useful console commands can be when developing software. Not too long ago we re-introduced the Symfony Console component. This component allows us to create structured and testable CLI commands. We created some simple commands and tested them; but when our commands become bigger and more complex, we need a different set of tools. This is what we are going to look at today: advanced Symfony console tools. Let’s create a command that we can use to show some of these features.

Closures, Anonymous Classes and An Alternative Approach to Test Mocking (Part 3)
I have heard people say that you shouldn’t test abstract classes or traits, only the concrete classes that implement or use them. I don’t follow that approach: unit testing is all about testing in isolation from anything that might affect those tests. Testing a concrete class that implements an abstract one, or uses a trait, means that the abstract class or trait is no longer fully isolated, but is being tested within the scope of the whole of that concrete class. We should still always test concrete classes as well; but we should also test the abstract classes and traits as individual units.

Promise-Based Cache With ReactPHP
In the previous article, we have already touched on caching (when caching DNS records). It is an asynchronous promise-based Cache Component. The idea behind this component is to provide a promise-based CacheInterface and instead of waiting for a result to be retrieved from a cache the client code gets a promise. If there is a value in a cache the fulfilled with this value promise is returned. If there is no value by a specified key the rejected promise returns.

Switching WordPress to HTTPS
Finally, after much deliberation, I decided to move my blog to https. For the past few months I had encountered articles pointing that out google gives a higher ranking for sites served over https. I had decided against https as I was afraid it may slow down my blog. However, receiving a message from google forced me to take the issue seriously and finally move to https.

Testing With PhpSpec
If you’ve never tried PhpSpec, one of the things that I love about PhpSpec is that the process generates code for you and guides you through the SpecBDD process through the command line. Let me show you what I mean with a quick tutorial.

Using PHP and MySQL with Ionic (** NOW UPDATED FOR IONIC 3 **)
According to W3tech's usage statistics PHP accounts for 82.4% of all the websites analysed which means there's a strong possibility that as developers we will, at some point, need to work with that language in our projects. This is no surprise as, amongst other features, PHP offers a solid and extensive Database API, supporting popular solutions ranging from MySQL, PostgreSQL, Oracle, SQL Server and SQLite to Sybase, Firebird and DB2.

Laravel QueryDumper
I wanted simple and quick way to see all running queries on any page of my laravel application especially accompanied by MySQL's EXPLAIN results. So I created very simple package called Laravel QueryDumper that allows me see just that.

New in Symfony 3.4: Better Console Exceptions
Designing exception messages is hard because they are mostly used in stressful situations. Their contents must achieve a delicate balance between giving enough information to find out the exception cause, and not giving too much information that could confuse or stress the user even more. In Symfony 3.3 we redesigned the web exceptions and in Symfony 3.4, we'll do the same with the console exceptions. The main problem of the original exceptions is that they focus on explaining what happened, ignoring where the exception happened.

Data Structure and Algorithm - Insertion Sort
In this tutorial, we will learn a simple sorting algorithm - Insertion Sort.

Install Laravel Valet on Ubuntu
If you come from a Mac environment, and have used Valet in the past, you'll know how easy it can make local development. No need to continually edit the hosts file, or use something like MAMP/WAMP. It also works for more than just Laravel, so is ideal for Wordpress and can be extended for other frameworks. It's also quite easy to install on Ubuntu!

Real Time IoT In The Cloud with SAP’s SCP, Cloud Foundry and WebSockets
Nowadays I’m involved with a cloud project based on SAP Cloud Platform (SCP). Side projects are the best way to mastering new technologies (at least for me) so I want to build something with SCP and my Arduino stuff. SCP comes whit one IoT module. In fact every cloud platforms have, in one way or another, one IoT module (Amazon, Azure, …). With SCP the IoT module it’s just a Hana Database where we can push our IoT values and we’re able to retrieve information via oData (the common way in SAP world). It’s pretty straightforward to configure the IoT module with the SAP Cloud Platform Cockpit.

How to Setup Docker for Your Symfony Project
As you probably know, I am a big Symfony fan :) In the last few years I used Vagrant to set up my Symfony development environment more or less as described here. But we now have Docker and it’s time to move forward with a new setup. Docker containers are generally more lightweight than Vagrant virtual machines, so starting and stopping them is extremely fast. They also take a lot less disk space.

Procedurally Generated Game Terrain with React, PHP and WebSockets
Last time, I began telling you the story of how I wanted to make a game. I described how I set up the async PHP server, the Laravel Mix build chain, the React front end, and WebSockets connecting all this together. Now, let me tell you about what happened when I starting building the game mechanics with this mix of React, PHP, and WebSockets…

My Simple Approach to using Docker and PHP
Getting started with Docker and PHP can still be a steep learning curve. You might feel that you don’t need something like Docker, and that Vagrant or full local development work just fine. I still use local development on some projects because the barrier to entry is small. You will likely face scenarios where you require different versions of PHP, work with multiple developers, and seek consistency between environments. When you’re working with a team, you need a consistent way to develop. I’ve been on teams where different versions of PHP and MySQL varied between developers. I want to show you how Docker can fill the gap of providing consistent development environments, and do so without a huge amount of added complexity.

Emitting Responses with Diactoros
When writing middleware-based applications, at some point you will need to emit your response. PSR-7 defines the various interfaces related to HTTP messages, but does not define how they will be used. Diactoros defines several utility classes for these purposes, including a ServerRequestFactory for generating a ServerRequest instance from the PHP SAPI in use, and a set of emitters, for emitting responses back to the client. In this post, we'll detail the purpose of emitters, the emitters shipped with Diactoros, and some strategies for emitting content to your user.
News and Announcements

PHP 7.2.0 Release Candidate 2 Released
The PHP development team announces the immediate availability of PHP 7.2.0 RC2. This release is the second Release Candidate for 7.2.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system.

WordPress 4.8.2 Security and Maintenance Release
WordPress 4.8.2 is now available. This is a security release for all previous versions and we strongly encourage you to update your sites immediately.

Laravel 5.5.5 Released With a New Route Fallback to Help Customise Your 404 Views
Laravel v5.5.5 was released September 19th and now includes a neat Route::fallback() method to help customise 404 views.

BetterReflection Version 2.0.0 Released
Roave's BetterReflection 2.0.0s was released today!

PHP Benelux - 26-27th January 2018, Antwerp
We are excited to announce the date for PHPBenelux 2018. Like every year we will have a theme, for this year all activities will be sports themed; Relax while watching some games, join the fun or just be a good sport. The conference is spread over 2 days: Friday afternoon (after the tutorials) and Saturday. Tutorials as well as the conference itself are spread over several parallel tracks. On Friday and Saturday evening, we’re having the conference social. This will include drinks and all the cool side activities. The Call for Papers is open now.

Sunshine PHP Conference - 8-10th February 2018, Miami
The SunshinePHP Developer Conference is hosted by the South Florida PHP community (SoFloPHP) in Miami, Florida from February 8th - 10th, 2018, and you're invited! We'll host some of the best speakers, awesome talk topics, latest technologies, and up to date news in PHP. And don't forget our Hack-a-thon and Uncon'ference, as well as a great hallway track! The conference has something for every level of PHP developer. We start on February 8th with a full day of 8 PHP related tutorials and workshops that are each 3 hours of in-depth information. Next we follow that with 2 days on February 9th and 10th containing 5 keynotes and 40 PHP talks over 4 tracks. The Call for Papers is still open, and Blind Bird tickets are on sale now.

Midwest PHP Conference - 9-10th March 2018, Minnesota
Midwest PHP is the FUN conference. This is our fifth annual conference, and each year it gets better and better. Our goal is to share best practices, ideas, and techniques about building state-of-the-art software applications. The Call for Papers is still open, and Blind Bird tickets are on sale now.

WavePHP Conference - September 19-21st 2018, San Diego
WavePHP Conference is bringing the wonderful PHP community to the Southwest United States. Designed to be a conference for both professionals and hobbyist alike. Held in beautiful southern California's San Diego County the area has ideal weather and tons of activities. Blind Bird tickets are on sale now.


Laravel IO Podcast Season 3: Episode 2 - Interview: Taylor Otwell, Creator of Laravel
An interview with Taylor Otwell, creator of Laravel, about what he did before Laravel and what got him started.

MageTalk Magento Podcast #143 -  “You Made Bricks, You Died at 21” (w/ Brian Lange)
Brian Lange of the Future Commerce Podcast joins us to talk "Magento Office Hours", a new community initiative by SD.

Zend Framework Quick Bites Episode 38 - The Zend Expressive Essentials Post-mortem
In this episode, I’m having a quick post-mortem about the Zend Expressive Essentials book, which is now on sale. I’ve loved writing the book and the accompanying code, and I’m thrilled that it’s selling so well. But it's always good, to be honest about what didn’t go so well, and where things could have gone better. In this episode, I do just that, in so much as I can with an episode limit of 3 minutes.

PHP Ugly Podcast #73: Mismanaged Funds
Topics include the new php[architect] podcast and Buddha on the Blockchain. 

php[architect] Podcast Episode 2 - Embracing Change
Welcome to the second episode of the php[podcast]. In this episode, we take a look at the September 2017 issue and the topic of managing changes both in your application and career.

Voices of the ElePHPants - Interview with Mark Story
This week Cal Evans talked to CakePHP core developer Mark Story.

Reading and Viewing

Practical Refactoring Tips For Developers That Love Legacy Applications
Many times in our career we have (or we’ll have) to deal with legacy applications, and refactoring is an art specially designed for this scenario. In this lightning talk, I’ll give a few tips that I’ve learned that helped me a lot to find love when dealing with refactoring legacy applications.

Take the Laravel 2017 Survey
Last year we partnered up with LaraJobs to put together a survey to see what types of projects people are taking on with Laravel as well as get some feedback on what the Laravel community could be doing better. The results ended up with over 1,600 submissions and some interesting insights. Because of the popularity we are bringing it back again this year and if you’re a Laravel developer or in charge of a Laravel team and have a few minutes we’d love for you to take the survey. The survey will remain open for a few weeks and then we will turn it off and share the results.

Cloudways Interview - Sucuri Co-Founder Dre Armeda Discusses WordPress Security
WordPress Security expert Dre Armeda of Sucuri lives in Los Angeles. He was an Informational Technologist at US Navy for more than 11 years. He left the US Navy and co-founded Sucuri, a well-known WordPress security firm. Later on, joined WebDevStudios, where he played a role of CMO. After 2 years of working at WD3, he joined back Sucuri as the co-founder and director of business development. His expertise includes entrepreneurship, marketing, branding, and everything that relates to WordPress and its security.

WordPress Security Top Tips
The popularity of WordPress cuts both ways. On one hand, it is very mature and supported by numerous plugins and themes. On the other hand, it is a frequent target of hackers. In this course, you'll learn some of the most important things you can do to secure your WordPress site from attackers. Reggie Dawson will show you some of the top plugins and key configurations that will help keep hackers out of your site.

The Best PHP Books of 2017 and 2016
Every year many books about PHP and related topics are released, but most of them do not get much notice from developers who would be very interested to learn about the books if they knew they existed. This article is a listing of PHP books that have been released in the last years that are best sellers on sites like Amazon. It was built with the collaboration of the authors that have written them, so they can tell you better what the books are about and why they will be useful if you read them.


Do you have a position that you would like to fill? PHP Weekly is ideal for targeting developers and the cost is only $50/week for an advert.  Please let me know if you are interested by emailing me at [email protected]

Interesting Projects, Tools and Libraries

PHP runtime & extensions header files for PhpStorm.

Lightweight and high-performance ORM with clean object design.

A collection of web applications which help software companies build better software.

Expresso PHP is a quick simple docker setup for all your PHP development.

PSX is a framework written in PHP dedicated to build REST APIs.

Cerberus is an IRC bot written for PHP.

Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functionality to the Pantheon's browser-based Dashboard and easier scripting.

Error tracking and logging from PHP to Rollbar.

A buildpack to deploy PHP applications to Cloud Foundry based systems, such as a cloud provider or your own instance.

A PHP API wrapper for Paystack.

A new generation content management system that allows you to create a website using drag and drop.

JSON Object Signing and Encryption Framework.

MyBB is a free and open source forum software.

This tool removes unnecessary files and directories from Composer vendor directory.

Please help us by clicking to our sponsor:


Everything You Need to Know About the SparkPost WordPress Plugin
Learn why SparkPost created a WordPress plugin, how you can use and contribute to it, and the maintenance process.

So, how did you like this issue?

Like us on FacebookFollow us on Twitter
We are still trying to grow our list. If you find PHP Weekly useful please tweet about us! Thanks.
Also, if you have a site or blog related to PHP then please link through to our site.

unsubscribe from this list | update subscription preferences 

Subscribe! Enter your email address below:

NO SPAM: We absolutely hate spam. We will not share, rent, or give away your email address to anyone.You can unsubscribe at any time. Easily!

Talk to us!

If you have some news, want to share a link with us or chat with us feel free to email us.

And we also have an RSS feed that you can use.

Like us on FacebookFollow us on Twitter

Copyright ©