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!

February 9, 2017

A very warm welcome to you out there in the PHP community, and thank you for joining us :)

With Docker the current "trending tool" gaining popularity, we take a look at running PHPUnit tests inside a docker container.

Also this week, on the Cloudways blog is an interview with Mike Gifford, the founder of a web development agency specialising in Drupal powered projects.

PHPKonf is coming up in May, hosted by the Istanbul PHP community in Turkey, and PHP creator Rasmus Lerdorf is already confirmed to speak. Tickets are on sale now.

Plus we have Part 3 of the Scaling Laravel Using AWS Elastic Beanstalk series, this week deploying the app to Elastic Beanstalk.

And finally, this weeks Acquia podcast pays tribute to the late, great "Webkenny", who sadly passed away late last year. The guys listen to, and reminisce over, the podcast they recorded with Kenny back in 2012. 

Have a great weekend everyone,

Katie and Ade

We love our sponsors. Why not try them?

 From our sponsors:
Know when and why code breaks Users finding bugs? Searching logs for errors? Find + fix broken code fast!

(ads by LaunchBit) 


10 Tips to Create Successful WordPress Themes
One of the things I love the most with WordPress is how easy to extend it using themes and plugins. But if you're attempting to create a theme for public distribution, (free or commercial), there's a few rules you should always respect in order to make your creation the best possible for its future users.

Moving to HTTPS Guide
A community site to help site owners migrate to HTTPS with a simple tested process. Allowing you to filter the plan based on multiple platforms (Wordpress, Magento, and more), hosting environments (cPanel, Apache, and more) along with the level of control / access you have over the site.

Why Is Codeigniter Recommended Over Other PHP Frameworks?
CodeIgniter is a famous PHP framework that has become the first choice for many proficient web developers and programmers. In this article, we figure out why CodeIgniter is better than other popular PHP frameworks. We bring forward the information on how CodeIgniter benefits and simplifies the web programming and development tasks for programmers. Knowing these facts, you can better learn the scope and standard of this PHP framework.

Tutorials and Talks

An Artisan Command to Easily Test Mailables
Most of the Laravel apps we create at Spatie will send mails. This can be a password reset mail, a welcome mail after registration, or an order confirmation mail. One of the things we do is styling such mails so it has the same look and feel as the site it was sent from. When testing such mails our designers had to request a password reset or go through the entire checkout flow just to receive such an order confirmation mail. To make that testing process a lot easier we’ve created a package called laravel-mailable-test. This package provides an artisan command that can send a mailable to an mail-address.

Using Dependency Injection in PHP
Dependency injection is a software design pattern that implements the inversion of a control concept for resolving dependencies. According to this concept, a class should not configure its dependencies statically, but should be configured from the outside.

BotMan Quick Tip - How To Use a Default Pattern
BotMan is a framework agnostic PHP library for building chatbots. In today's tip I want to show you how to use a default pattern when using an array of callbacks.

A Practical Introduction to TypeScript for PHP Developers
Most developers I know should be classified with the trendy word polyglot. Polyglot means a person that speaks multiple languages, whereas for developers they're programming languages. Even if you consider yourself as a PHP developer, you're likely more diverse. Programming languages rise and fall in relevance, so your skillset and routine varies over time - depending on trends as well as the line of work you're in. Let's take a practical look at why you might find TypeScript a worthy language to use in 2017 and beyond.

Programming With Yii2: Automated Testing With Codeception
In this Programming With Yii2 series, I'm guiding readers in the use of the Yii2 Framework for PHP. In this tutorial, I'll explore automated testing using Codeception, which is integrated with the Yii2 development framework.

Deprecations for PHP 7.2
The PHP 7.2 RFC for deprecating some current functionality has been approved. The following items are included in this list and will begin throwing deprecated notices.

RabbitMQ: Publish, Consume, And Retry Messages
RabbitMQ is a message broker, allowing you to process things asynchronously. There’s already an article written about it, if you’re not familiar with RabbitMQ. What I’d like to talk to you about is the life cycle of a message, with error handling. Everything in a few lines of code. Therefore, we’re going to configure a RabbitMQ virtual host, publish a message, consume it and retry publication if any error occurs.

Rendering ApiProblem with PSR-7
In the API I'm currently building, I'm rendering errors using RFC 7807: Problem Details for HTTP APIs. As this is a Slim Framework project, it uses PSR-7, so I updated rka-content-type-renderer to support problem.

Migrating to PHPUnit 6
The first version of PHPUnit 6 was released today. Today also marks the End of Life of PHPUnit 4. What does this mean for you? The answer to this question depends on which versions of PHP and PHPUnit you currently use.

Scaling Laravel Using AWS Elastic Beanstalk Part 3: Setting up Elastic Beanstalk
In my last article we set up the supporting services we would require for our Laravel app once we deploy it to the Elastic Beanstalk architecture. We created a VPC to keep our infrastructure secure, we created a MySQL database in RDS, and we set up ElastiCache for our Redis cache. So now that our Laravel app is decoupled and our supporting services are in place, it’s finally time to deploy our app to Elastic Beanstalk.

Streamed File Zipping and Downloading in PHP
Did you notice that on, you can select a folder and start downloading it while it’s being zipped? This on-the-fly zipping feature comes handy for both the user and the server  -  as a user you don’t have to wait until the files are zipped on the back end before the downloading starts, and it saves the server from creating a temporary zip file and deleting it afterwards.

Dynamic Image Resising via URI with Glide and Slim
If you have ever used backend you will notice its image resizing works by appending a dimension string at the end of the URL. In this tutorial, we will show you how to do that for your own project. At the end of this tutorial, you will have an image resizing server that is able to give you specific dimensions upon request. 

How to Make Modern PHP More Modern? With Preprocessing!
Let’s have a bit of fun. A while ago, I experimented with PHP macros, adding Python range syntax. Then, the talented SaraMG mentioned an RFC, and LordKabelo suggested instead adding C#-style getters and setters to PHP. Aware of how painfully slow it can be for an outsider to suggest and implement a new language feature, I took to my editor…

Run PHPUnit Tests Inside a Docker Container From PhpStorm
Docker is, without any doubt, the trending tool these days. Everybody wants to use it, because it is very useful, allowing to easily generate development environments for any kind of application. A couple of months ago I started working with docker myself (it has taken me a while, I know), and now I can't imagine working without it. I started using it at work, but now I'm migrating all of my OSS projects too.

Building Your Startup: Ajax for Meeting Times and Places
Last week, I delved deeper into Ajax to transform the meeting scheduling experience into a fully ajaxified model and eliminated the need for page refreshes. I got about halfway, focusing mostly on the straightforward elements. In today's tutorial, I'll guide you through the more complex content panels that required a lot more troubleshooting, research, debugging, brainstorming and recoding.

Paginating Data Collections With Zend-Paginator
Zend-paginator is a flexible component for paginating collections of data and presenting that data to users. Pagination is a standard UI solution to manage the visualisation of lists of items, like a list of posts in a blog or a list of products in an online store. Zend-paginator is very popular among Zend Framework developers, and it's often used with zend-view, thanks to the pagination control view helper zend-view provides. It can be used also with other template engines. In this article, I will demonstrate how to use it with Plates.
News and Announcements

Laravel Spark 4.0 is Released
Laravel Spark v4.0 is now released and available to all license holders. Spark 4.0 is a free upgrade and provides compatibility with Laravel 5.4. Also, Spark 4.0 applications are configured to use Laravel Mix and Webpack instead of Laravel Elixir.

PHPUnit 6.0.0 Is Released
PHPUnit has released version 6.0, and it now drops support for PHP 5.6, which is no longer actively maintained.

Nette 3.0.0 Alpha Has Just Been Released!
Nette is the first framework to use PHP 7.1 features, using strict_types, scalar type hints and return type hints, which is a fundamental step towards more robust applications.

PHPKonf - May 20th-21st 2017, Istanbul
PHPKonf is hosted by the İstanbul PHP community (İstanbul PHP) in İstanbul, Turkey from May 20th 2017, and you're invited! For the 4th year, we'll host some of the best speakers, awesome talk topics, latest technologies, and up to date news in PHP. The conference has something for every level of PHP developer with awesome keynote and 14 talks (multi-track). So come meet other PHP developers and see what others are doing, and please share your experience as well. Then relax or have some fun at the evening events with plenty of fun for everyone! Tickets are on sale now.

PHP Serbia Conference - May 27-28th 2017, Belgrade
PHP Serbia Conference delivers high-value technical content about PHP and related web technologies, architecture, best practices and testing. It offers two days of amazing talks by some of the most prominent experts and professionals in the PHP world in a comfortable and professional setting. Tickets are on sale now.

PHP South Coast - June 9-10th 2017, Portsmouth
That’s right, PHP South Coast conference in 2017 will be running not one, but two days of talks on 9th-10th June 2017. This means there will be more opportunity for new speakers to be a part of the conference as well as more experienced speakers being present on the lineup. On the Friday we will have two tracks all day, followed by a social event in the evening (more details to be announced). On Saturday we will have one track of talks, starting slightly later in the morning so that everyone is nice and refreshed from the night before :) Early Bird tickets are on sale now.

Web Summer Camp - August 30th-September 2nd 2017, Croatia
Hands-on and engaging workshops providing useful know-how and first-hand experience, along with encouraging knowledge sharing. We are looking for PHP, eZ Publish/eZ Platform, Symfony, JavaScript, React/React native, user experience, user research, information architecture, design systems, CSS and project management workshops. The Call for Papers is open now.

Nomad PHP US - March 16th 2017 20:00 CDT
Yielding Higher-Performance PHP Applications, presented by Ian Littman. Not long ago, there was one sane model for running web applications in PHP: handle one simultaneous request per process, build everything up at the beginning of the request, tear everything down at the end, and block on I/O everywhere along the way. That’s still the standard for PHP web applications. But with advances in the PHP runtime…and new concurrency frameworks like Icicle and AMPHP on top of those new features…PHP applications can behave a bit more like Node.js ones, with the application itself serving web requests…and outlasting them…interleaving multiple concurrent requests via async I/O. Those advances can pack more performance into a given application, handling more requests per second and taking less time per request than a more traditional setup. We’ll take a look at the basic concepts powering this new wave of async frameworks (generators!), then dive into how you’d build an application that runs on top of those frameworks, including an example app that showcases what async I/O can do to shorten response times and squeeze more requests per second out of an all-elsse-equal hardware and software setup.

Nomad PHP EU - March 16th 2017 20:00 CET
Zend Framework Done Right, presented by Gary Hockin. While the upgrade path from ZF2 to ZF3 is nowhere near as complicated as from ZF1 to ZF2, there are still plenty of things the prepared developer needs to know to make upgrading as seamless as possible. In this session, we’ll cover the backwards compatibility breaks, and which parts of your application you’ll need to rewrite, but also the forward facing changes that are in ZF2 right now that allow you to make many of your changes before you even upgrade to ZF3.


That Podcast Episode 37: Sold!
Beau and Dave discuss time bugs, companies being sold and AppleApp Store and Google Play store tax on "digital sales." They also talk about recent news in Symfony. This episode is the first edited by Beau. Be gentle.

Three Devs and a Maybe Podcast - API Ramblings with Phil Sturgeon
In this weeks show we are joined by Phil Sturgeon to discuss all things API development. We start off by mentioning Phil’s new job at WeWork, Startup life/culture and switching between different development philosophies. We move on to highlight how he got into API development, the reasons behind writing the book “Build APIs You Won’t Hate” and a future video-series he has in the pipeline. This leads us on to discuss common misconceptions of REST and RPC, API tooling available and the different data-formats present. Finally, we mention the importance of good error-handling within an API (no 200 responses!) and some of the bad-stories he has heard/encountered on the topic.

Acquia Podcast: Godspeed, Webkenny - Episode 57 Rebroadcast And Commentary
Acquia Podcast 57 rebroadcast + commentary - Kenny "webkenny" Silanskas passed away in late 2016. Kenny was a Drupalist, a colleague at Acquia, a musician, and a good, funny person who touched my life and the lives of many others. Godspeed, Kenny. We miss you and your huge laugh. Here, Robert Douglass and I listened to the podcast I recorded with Kenny in 2012, reminisced, and talked about the early years at Acquia and the origins of the DrupalCon Prenote. The second half of the podcast is my conversation with Kenny from 2012 and the audio version of his performance in the DrupalCon London Prenote in 2011.

MageTalk Magento Podcast #114 - The First Rule of Side Conversation is Don’t Mention Side Conversation (w/ Rebecca Troth)
Rebecca Troth joins the guys to talk about her history and growth in the Magento Community.

Zend Framework Quick Bites Episode 23 -  Episode 23 - FactoryCreator and ConfigDumper - Overview
In this episode I’m talking, broadly, about the two latest tutorials on Master Zend Framework. These tutorials begin the exploration of some excellent new features in the latest version of Zend ServiceManager 3.2.0. What’s more, Gary Hockin, one of the core developers behind these changes, shared some interesting tidbits about where tooling’s headed in Zend ServiceManager as well.

PHP Ugly Podcast #46: Canada Calls
This weeks topics include the idea of a Laravel Conference in Canada, and Laravel Dusk.

North Meets South Web Podcast Episode 22 - Non-Recording, Updating Laravel, and Huge Manatees
After a hiccup that led to having to re-record the first five minutes of the show, Jake and Michael talk about manually updating Laravel apps and the virtues of doing so regularly, a brief outburst on politics, and comparing modern JavaScript frameworks with legacy jQuery.

Reading and Viewing

Cloudways Interview - Mike Gifford Discusses Drupal, Accessibility Related Issues And The Amazing Drupal Community
Mike Gifford is the Founder and President of OpenConcept Consulting Inc., a web development agency specialising in Drupal powered projects. With over 16 years of experience in architecting secure, scalable, inclusive and sustainable solutions for the not-for-profit, public and private sectors, Mike Gifford is involved in making the internet a better place using open-source software.

Top Web Design Mistakes Made By Beginners Kindle Edition (by Matthew Sawyer, published 7th January 2017)
Are these killer web design blunders destroying the effectiveness of your website? Well now you can find out how to design your web sites the right way! Uncover the most common mistakes people make when designing websites, and how they can absolutely destroy your SEO or conversions!

Design Patterns in PHP and Laravel Paperback (by Kelt Dockins, published 14th January 2017)
This book teaches you design patterns in PHP and Laravel using real-world examples and plenty of humour. Too often design patterns are explained using tricky concepts, when in fact they are easy to use and can enrich your everyday development. Design Patterns in PHP and Laravel aims to break down tricky concepts into humorous and easy-to-recall details, so that you can begin using design patterns easily in your everyday work with PHP and Laravel. 

Object-Oriented PHP Best Practices: 23 Commandments for Writing Readable, Sustainable Code (by Ikram Hawramani, published 29th January 2017)
There are generally two types of programmers; those who write messy code, and those who have to deal with the mess. This small book teaches how to become the third type of programmer; the one who writes readable, maintainable code that makes life easy for themselves, their teammates, their future selves, new talent additions to their team, and possible changes of ownership. By helping you and your team avoid the various pitfalls common to object-oriented PHP projects, this book helps take the code out of your way so that you can focus on the business problems you need to solve. The 23 commandments provide a balanced approach to theoretical best practices, productivity, long-term maintenance considerations, and performance. This is a short book that can be read in one sitting. Invest a lunch break or two reading it and you will thank yourself for it later.


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

Schematic is a minimalist library (only three classes and less than 400 lines of code at all) that helps your IDE to understand a structure of associative arrays in your PHP applications.

Spress is a static site generator built with Symfony components.

The C based grpc (C++, Node.js, Python, Ruby, Objective-C, PHP, C#).

PHPloy is an incremental Git FTP and SFTP deployment tool.

A simple & powerful router for PHP 5.4+.

A PHP swagger annotation and parsing library.

ElkArte is a modern, free, powerful community building forum software. It is completely free and licensed with an open source BSD 3-clause license.

PHPWord is a library written in pure PHP that provides a set of classes to write to and read from different document file formats. 

Gravel is a PHP library for working with Gravatar avatars.

Exchange rates library for PHP 5.3+.

A key/value database store using flat files for PHP.

Rapid API development framework for PHP.

The highly extensible, highly enjoyable, PHP testing framework.

A simple, low-level PHP extension for libsodium.
Please help us by clicking to our sponsor:

 From our sponsors:
Know when and why code breaks Users finding bugs? Searching logs for errors? Find + fix broken code fast!

(ads by LaunchBit) 

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 

Protect your PHP code with SourceGuardian 10. Free trial.


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 ©