|Hi there PHP fans ;)
What would you like from PHP Weekly?
As you probably know, this is a side hobby project for us and we have kept this format from the start, but I feel it's getting a little stale. It would be GREAT to hear from you to let us know what you would like to see in each issue, what changes or what could help you. We are looking at talking with companies about weekly special offers, training courses etc but we nee to hear from you about what you want. You receive a lot of email, so how can we make this one useful :) ?
If you can drop Katie an email to firstname.lastname@example.org with any thoughts we'd really appreciate it
All the best and have a lovely day
Ade and Katie
We love our sponsors. Why not try them?
From our sponsors:
||Exclusively to PHP Weekly readers, we have an offer on SourceGuardian, up until the end of June 2016, to receive 25% off the $199 purchase price of SourceGuardian. Powerful encryption for your PHP code. Download the free trial and use the following discount code: bldcvzrh0FIw5AoY
(ads by SourceGuardian)
Why PHP-FIG Matters
The PHP-FIG is currently going through some growing pains. Since its inception 8 years ago, the groups greatest problem has been to properly organise itself. From having followed the mailing lists for that time, I believe that the amount of emails entailing “the process, by-laws, voting and general bureaucracy” outnumber the actually productive technical discussions by maybe something like 4 to 1. This is a lot of wasted time, for a lot of people, and while (some) good documents have come from it, it is an incredibly inefficient process.
Don’t Try To Be Too Smart. Be Boring, Predictable and Consistent.
When designing an API, it’s tempting to do a bit of extra work and surprise the developers using it. It might be returning some additional information that would require an additional call otherwise, or try to predict the intentions and handle some specific cases differently. The intentions are perfectly fine — provide a pleasant, simple interface. The problem is that it requires making assumptions which, sometimes, are inevitably wrong. The worst case is when the API makes an assumption of what the developer expects to get back, gets it wrong, and returns something unexpected. More work with docs, more bug fixing.
When to Abstract?
One of the most difficult challenges in a developers life is finding the "right" abstraction, or at least the best one given the current circumstances. The core problem is that abstraction is a bet on the future development of the software and we know that future is volatile. The circumstances will change, so will the view on the best abstraction change. But there is another dimension which influences this decision: What kind of software are you developing?
Tutorials and Talks
Filtering the PSR-7 Body in Middleware
Sometimes, there's a requirement to alter the data in the Response's body after it has been created by your controller action. For example, we may want to ensure that our brand name is consistently capitalised.
Writing Your Own Test Doubles
Once in a while I run into a situation where trying to use a mocking library hurts the readability of my test.
Fast Debugging of PHP Code Using PHPEd Part 2: Debugging Symfony Applications
The first part of this article covered how we can take advantage of a PHP IDE like PHPEd to find and fix bugs using its debugger capabilities. Read this part of the article to learn how to debug a framework based application, specifically using Symfony, combining the power of PHPEd debugger and common framework principles to debug code faster.
Building a SparkPost Client: TDD with PhpUnit and Mockery
In a previous post, we looked at SparkPost (as an alternative to Mandrill), and explored a bit of the official PHP client. The official client handles a decent amount of work, but I got to thinking about what it would take to build a new client. The more I thought about it, the more it made sense. I could learn about the SparkPost API, and practice Test Driven Development at the same time. So, in this post we’ll look to do just that!
Learn Symfony and Modern PHP with Bolt 3.0 - a Silex Powered CMS
On Tuesday 10th of May the development team released a new major version of Bolt CMS. The Open Source content management system is a lightweight and easy to use tool for managing websites and blogs. In addition it's perfect for learning modern PHP development practises.
Anonymous Class Factory – The Results Are In
A week or so ago, I published an article entitled “In Search of an Anonymous Class Factory” about my efforts at writing a “factory” for PHP7’s new Anonymous Classes (extending a named concrete base class, and assigning Traits to it dynamically); and about how I subsequently discovered the expensive memory demands of my original factory code, and then rewrote it using a different and (hopefully) more memory-efficient approach. Since then, I’ve run some tests for memory usage and timings to assess just how inefficient my first attempt at the factory code was, and whether the new version of the factory really was better than the original.
When Possible, Use File *Resources* Instead Of File *Names*
In testing the Aura.Http package, I have realised that it’s much more flexible, testing wise, to pass around file resources (a.k.a. handles, pointers, or streams) than it is to pass around file names. When you do that, you can use a php://memory stream instead of attempting to touch the file system.
How to Setup and Use The Google Calendar API
For a project I’m working on I needed to interact with a Google Calendar. If you've ever worked with some APIs by Google then you know their documentation can be very confusing. It’s not that they don’t have documentation, but code examples of common use cases are simply not present. You must wade through a lot of pages to learn basic things such as how to make an authorised request, let alone how to fetch calendar events. In this post I’d like to explain in a human readable way how to set-up and use the Google Calendar API.
Solve All Your Cryptography Problems in 3 Easy Steps
Last year, we began developing Halite, a FOSS high-level wrapper for the PHP bindings to libsodium. We use Halite extensively in our own projects (including our upcoming CMS which has quite a few of its own innovative cryptography features baked-in). As of version 2.1.0, we are confident that Halite solves all of the application-layer cryptography problems that most PHP developers face; and it does so in three easy steps.
An Overview of PHPUnit 5 – What’s New? What’s Coming?
It was January 2016 when the PHPUnit development team announced the release of PHPUnit 5.0. While several minor versions have already been released since, PHPUnit’s major version 5 has introduced several new functionalities and deprecated a few others. In this article, we’ll take a look at the most notable changes.
Towards CQRS, Command Bus
By following the Command / Query Responsibility Segregation (CQRS) principle, we separate "write" logic from "read" logic. This can be applied on many levels, for example on the macro one we can have a single "Publisher" server (write) with many "Subscribers" servers (read), and on a micro level we can use this principle to keep our controllers small. However, transitioning from a regular mindset to a CQRS one can be difficult. In this article, we'll explore the "Command Bus" pattern, to help us to get the Command (write) part right.
Enrico just returned from phpDay, where he spoke about Expressive and the upcoming Zend Framework 3. One piece of feedback he brought back had to do with how people perceive they should be building Expressive applications: many think, based on our examples, that it's completely configuration driven!
Sharing Authentication Between Socket.io and a PHP Frontend
Normally, when I work with websockets, my stack is a socket.io server and a Silex frontend. Protect a PHP frontend with one kind of authentication of another is pretty straightforward. But if we want to use websockets, we need to set up another server, and if we protect our frontend we need to protect our websocket server too. If our frontend is node too (express for example), sharing authentication is easier but at this time we want to use two different servers (a node server and a PHP server). I’ve written about it too but today we`ll see another solution.
Combining WebComponents with PHP via PrimeElements
|News and Announcements
Announcing the Fourth Symfony Docs Hack Day - May 21st 2016
The Symfony project is proud to announce its fourth Symfony Docs Hack Day. This Hack Day will be an online event to give a push to the Symfony Docs before the Symfony 3.1 release at the end of this month.
PHP UnConference Europe - May 28-29th 2016, Majorca
PHP UnConference 2016 is in its 5th year. Anyone who has attended a conference knows that the most interesting pieces of information and experiences do not come from the presentations themselves, but from the time spent speaking with other attendees between the presentations. The idea of an UnConference is for the attendees to decide on the topics they are most interested in, and the speakers they would like to present them, decided on the day. Tickets are on sale now.
International PHP Conference - May 29th-June 2nd 2016, Berlin
The International PHP Conference is the world’s first PHP conference and has been going for more than a decade, for top-notch pragmatic expertise in PHP and web technologies. Internationally renowned experts from the PHP industry meet up with PHP users and developers from large and small companies. Tickets are still on sale.
PHP South Coast - June 11th 2016, Portsmouth
This one day event will be packed with excellent talks from speakers around the world, followed by dinner and an evening social. Tickets are on sale now.
Dutch PHP Conference - June 23rd-26th 2016, Amsterdam
Ibuildings is proud to organise the tenth Dutch PHP Conference on June 24th and 25th, plus a pre-conference tutorial day on June 23rd. Both programs will be completely in English so the only Dutch thing about it is the location. Keywords for these days: Know-how, Technology, Best Practices, Networking, Tips & Tricks. Tickets are on sale now.
Nomad PHP US - June 23rd 2016 20:00 CDT
Don’t Be The Last To Know! Strategies & Tactics for Monitoring Your System & Services, presented by Elisa Towbis. When something goes bad – who knows about it first: you or your customers? Whether you are a provider of apis, or a consumer of services from other vendors, being aware of system issues … before your customers … is a critical factor to minimising downtime and keeping business-critical operations running. Cloud computing and distributed processing “cloud services” change the way you think about your system. It still starts with CPU, memory and disk – but doesn’t end there. This talk will focus on finding touch points for monitoring your system and tools that could help you be the first to know!
Nomad PHP EU - June 23rd 2016 20:00 CEST
Introduction to Event Sourcing and CQRS, presented by Beau Simensen. Have you heard about event sourcing and wondered what it is all about? Have you looked into it and wondered what sort of sorcery is going on behind the scenes that makes this magical technology work? Are you convinced that you cannot possibly move your existing applications to be event sourced? Take a step back and learn how event sourcing can be applied to a simple database-backed object model with little to no fuss. From there, see how you can start adding read models and begin to see how event sourcing and CQRS (Command Query Responsibility Segregation) go hand in hand!
Three Devs and a Maybe Podcast - RFC Showdown for PHP 7.1 with Joe Watkins
In this episode we are joined by Joe Watkins to discuss the many RFC’s that are in contention to be approved for PHP 7.1. We start off with a congratulations to Joe for his first PHP Release Manager position, highlighting what the role entails and how it is going. We then discuss the RFC process and how there has been a lot of activity over the past couple of weeks within this space. The concept of ‘Null’ is the first group of RFC’s we discuss, followed by union/intersection types and the pipe operator. We then move on to chat about short closure syntax, functional interfaces and lexical scope within anonymous classes. Finally, we bring up the comparable RFC which has been around for many years and the benefits of having attributes within the language.
The Laracasts Snippets Episode 24 - About Frameworks Being Dead...
Every six months or so, it pops up again: "Frameworks are dead." But...is that the case? What does that really mean? Let's chat.
MageTalk Magento Podcast # 92 - Lavelle’s Magic Fingers (Imagine 2016 Recap, Part 2)
The guys finish up their recap of the goings-on at Magento Imagine 2016.
Laravel News Podcast LN16: Laravel Valet with Taylor Otwell and Adam Wathan
In this special edition episode of the Laravel News Podcast, we are joined by Taylor and Adam as they discuss everything about Valet, how it came to be and the amazingly short time from idea to completed product. They talk about the internals, how it works, how external sharing works, the driver architecture and more.
The John Morris Show Podcast - jQuery: Find An Anchor By Its HREF
jQuery selectors can be a bit tricky. :first-child, :last-child, nth-of-type, is it zero-based, why is it grabbing that element when I expected this one. Fun stuff. On a recent project, I needed to find an anchor tag by its href so I could then replace it with my own URL… and that got me thinking about jQuery selectors again. So, let’s run through some and try to clear up some confusion.
Voices of the ElePHPant - Interview with Amanda Folson
Recorded at php[world] Cal Evans talks to developer evangelist Amanda Folson.
Lately in PHP Podcast Episode 71 - How PHP 7.1 May Eliminate Frameworks BootStrap Overhead
One of the greatest performance killers of applications that use large frameworks or libraries is the overhead of bootstrap processes that is necessary to initialise the objects of their classes. The good news is that a new feature called startup snapshot inspired on V8 engine (used by Chrome and Node.js) is being discussed to implement on PHP 7.1, so applications based on those frameworks take less time to startup and run. The startup snapshot optimisation was one of the main topics discussed by Manuel Lemos and Arturs Sosins in Episode 71 of the Lately in PHP podcast hangout.
A Year With Symfony - End Of Life
My first book, A Year With Symfony, was well received when I first published it on September 4th. At the time it seemed to be a welcome addition to the official Symfony documentation. A lot of water has passed under the bridge since then. Several new Symfony components were released and we have now arrived at the next major version, 3.0. In the meantime I published one update of the book: a new chapter about Annotations.
Cloudways Interview with WordPress's Ryan Hellyer
Ryan Hellyer is a very well known WordPress obsessed Kiwi and a former scientist, who used to live in Canada, then Norway and now Berlin. He has been contributing to WordPress communities for a long time. He is a prolific plugin developer, a mentor who shares his knowledge openly in the form of code snippets and tutorials. In this interview with Cloudways, he talks about WordPress and his personal life. He also shares his experience about AWS Nightmare.
Mastering OAuth 2.0 Published
I’ve published my first article in php[architect] magazine since 2009! It’s only fitting that it’s an article on OAuth 2.0, since one of the last articles I published in their magazine was on OAuth 1.0. I’m proud and excited to finally publish a new article with them after such a long hiatus, and I hope my next article doesn’t take seven years to write.
LESS and Front-End Tooling with PHP
There are so many Front End tools and workflows out there now that it is almost intimidating for a true PHP developer to consider any one of them. I’ll walk through a set-up we use on client projects at Mercutio, that leverages LESS, Grunt and Bower in a PHP framework-agnostic way. With these tools established it allows for every front end dev to work on any of our PHP projects with consistency and a short ramp up time.
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@example.com
Interesting Projects, Tools and Libraries
Unirest in PHP: Simplified, lightweight HTTP client library.
Phinx makes it ridiculously easy to manage the database migrations for your PHP app.
Sophisticated, lightweight & simple CMS.
CodeLite is an open source, free, cross platform IDE for the C/C++ programming languages which runs on all major platforms.
OpenCart is a free open source ecommerce platform for online merchants.
Humbug is a Mutation Testing framework for PHP.
Simple automatic PHP image gallery with Bootstrap, SASS and Lightbox integration.
A system for organising, loading and introspecting PHP classes and functions.
Alice allows you to create a ton of fixtures/fake data for use while developing or testing your project.
Pickle installs PHP extensions easily on all platforms.
A simple and swift MongoDB abstraction layer for PHP 5.4+.
A Copy/Paste Detector (CPD) for PHP code.
A highly customiseable and blazing fast ORM library for PHP 5.4+.
Purl is a simple Object Oriented URL manipulation library for PHP 5.3+.
Plum is a data processing pipeline for PHP that helps you to write structured, reusable and well tested data processing code.
A centralised repository for PHP-related brews.
Base is a simple database abstraction in PHP.
|Please help us by clicking to our sponsor:
From our sponsors:
So, how did you like this issue?
Protect your PHP code with SourceGuardian 10. Free trial.