Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

php[architect] Podcast:
Episode 2: Embracing Change
Sep 27, 2017 @ 09:42:27

The folks behind php[architect] magazine have posted the second episode of their podcast - Episde #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.

Topics mentioned include using version control and testing as tools when projects change, an interview with Ben Ramsey about PHP TestFest and the keynotes at the upcoming php[world] conference. You can listen to this latest episode either using the in-page audio player or by downloading the mp3 of the show for listening at your leisure.

tagged: phparchitect podcast ep2 embracing change sept2017 issue benramsey oscarmerida

Link: https://www.phparch.com/podcast/episode-2-embracing-change/

php[architect]:
September 2017 Issue Release - Embracing Change
Sep 06, 2017 @ 13:18:34

php[architect] magazine has released their latest issue for September 2017: Embracing Change

Articles included in this issue include:

  • How I Git Along by Jason McCreary.
  • Karl Hughes shares True Tales of Building PHP Microservices.
  • Learn about Learning Machine Learning, Part One: Begin with What You Know by Edward Barnard.
  • How to evaluate a job offer in Jumping Ship: A Holistic Approach to Changing Jobs - Part Two by Andrew Koebbe.

...as well as many of the usual columns you know and love. You can check out the full list of articles on the php[architect] site and check out the free article for a sample of the issue's content.

tagged: phparchitect magazine september2017 embracing change issue release

Link: https://www.phparch.com/magazine/2017-2/september/

Jason McCreary:
You changed the code, you didn't refactor the code.
Jul 13, 2017 @ 11:16:27

Jason McCreary has a post with an interesting perspective about code refactoring and what it means to refactor. He suggests that just changing code isn't refactoring and that it's more about changes in the observable behavior.

There was a good discussion on Twitter yesterday regarding a code contribution to the Laravel framework. It ended with some good questions about the distinctions between “refactoring” vs “changing” code.

While I want to focus on these distinctions, let’s first focus on the code change.

He gives an example of some code from the suggested change that reduced the number of lines in a before function call that still satisfied the requirements defined by the unit tests. He suggests that, while this change allowed the method to work as expected, it was more of a "change" than a "refactor". He suggests that because the code internal to the method changed that the "observable behavior" changed because of a special case with the return value. Existing tests didn't catch the change so it was assumed the refactor was successful even when it wasn't. Adding this test and fixing the issue then resulted in a true refactor and not just a change.

Given the symbiotic relationship between refactoring and testing, some consider the tests to be the requirements. So if all tests pass, you met the requirements. I think that’s a slippery slope. For me, the definition of “refactoring” again provides the answer through its own question - did we change the observable behavior?
tagged: code change refactor opinion unittest patch laravel

Link: https://jason.pureconcepts.net/2017/07/refactor-vs-change-code/

Hackernoon.com:
Automatically Running PHPUnit With Watchman
Apr 12, 2017 @ 10:40:55

On the Hackernoon site today Sebastian De Deyne has written up a tutorial showing you how to use Watchman to automatically run PHPUnit tests for your application when things change. Watchman is a tool from Facebook that watches files and directories for updates and execute actions based on the changes.

Watchman watches files and triggers actions when they change. The reasoning behing choosing Watchman: it’s easy to install, simple to configure, and reliable.

The watchman-make command - which ships with Watchman - is a specialised interface for Watchman to invoke build tools in response to file changes - exactly what we need!

In the setup he creates, Watchman is used to look for changes on files in either the project's src/ or tests/ directories and execute a bash script (code provided) that runs the tests and outputs the results. He walks through each line of the script and Watchman command, explaining how it works and what the option points to. You can see the results here of an edit to a test and the output in a Terminal window once it's saved.

tagged: watchman phpunit test automatic execution change facebook tutorial

Link: https://hackernoon.com/automatically-running-phpunit-with-watchman-e02757e733e7

SitePoint PHP Blog:
Upgrading from PThreads v2 to V3: What to Look out For
Mar 30, 2017 @ 12:43:15

On the SitePoint PHP blog Thomas Punt has returned with more pthreads knowledge and shows you a few things to watch out for when upgrading from pthreads v2 to v3. pthreads is a PHP extension that allows for better process handling directly from PHP than just the built in proc_* functions.

A fair amount has changed for the pthreads extension with the release of pthreads v3. This article aims to cover the necessary information for those who are looking to upgrade their applications from pthreads v2 to v3.

If you’re unfamiliar with pthreads, check out my introduction to pthreads instead!

He starts with some of the more generic changes in this latest version with the most major being that it can now only be used in the command-line environment. Other changes were made to workers, method modifiers and the removal of some classes and methods. He also mentions some of the methods that were changed and some new classes/methods that were added. Overall he's of the opinion that, while some of the changes could make for headaches in the transition, v3 of the extension has "received a nice cleanup and is looking ever better."

tagged: pthreads threading version change upgrade guide

Link: https://www.sitepoint.com/upgrading-pthreads-v2-v3-look/

TutsPlus.com:
Building Your Startup: Requesting Scheduling Changes
Feb 07, 2017 @ 12:44:23

The TutsPlus.com site has continued their "Building Your Startup" series with this new article enhancing the application they've already created to send requests for scheduling changes.

As the Meeting Planner alpha testing phase began, the clearest feature gap was the inability to change a meeting after it had been scheduled. It's not an easy problem. Is it okay to just change a meeting without a participant's permission? Or should you ask? Or do either, depending on your role in organizing the meeting? What if you just want to ask if it's okay to meet 15 minutes later—that should be easy, right?

Solving all this required some reflecting on the social aspects of adjusting a meeting. Over time, I realized that the ability to adjust meetings easily after they've been scheduled could make or break the Meeting Planner brand.

He then starts out by describing the "tall mountain to climb" in the number of changes to backend, frontend and UX/UI functionality required to add the feature. He includes all of the code changes and additions that need to be made including:

  • migrations to add new tables
  • UI updates to add options for rescheduling requests
  • form changes
  • handling request submissions

Each point on the list includes code, screenshots and anything else that was required to make the update.

tagged: startup build scheduling change yii2 tutorial ui backend frontend

Link: https://code.tutsplus.com/tutorials/building-your-startup-requesting-scheduling-changes--cms-27076

TutsPlus.com:
Building Your Startup: Advanced Scheduling Commands
Jan 30, 2017 @ 10:56:17

The TutsPlus.com site has updated their "Building Your Startup" series with their latest tutorial showing you how to build advanced scheduling commands allowing for things like repeating meetings, updating the meeting details and rescheduling.

I also began to realize that the ability to adjust meetings easily after they've been scheduled could make or break the Meeting Planner brand. [...] In today's tutorial, I'll cover expanding the navigation bar using Bootstrap and the basics of building some of the advanced scheduling features within Meeting Planner. Next week, I'll review building the more complex feature for participants to request change(s) and for others to accept or decline them.

He starts with the frontend, updating the navigation bar to include links to other functionality for meeting changes, repeating and showing planning activities for the meeting. He uses Bootstrap's single-button dropdowns for this and includes the code to add them to the UI with a bit of code in the view. He then gets into the main functionality of these changes showing the code to:

  • make changes to a current meeting
  • reschedule a meeting
  • repeat a meeting
  • resend invitations

The next part in the series will take a look into social engineering and UX needs for the application along with some other smaller changes.

tagged: startup tutorial series advanced scheduling commands change update meeting

Link: https://code.tutsplus.com/tutorials/building-your-startup-advanced-scheduling-commands--cms-27075

TutsPlus.com:
Building Your Startup: Delivering Notifications
Nov 04, 2016 @ 10:54:14

TutsPlus.com has posted the latest part in their "Building Your Startup with PHP" series today with a focus on delivering notifications to your users when meeting information is updated.

This tutorial is part of the Building Your Startup With PHP series on Envato Tuts+. In this series, I'm guiding you through launching a startup from concept to reality using my Meeting Planner app as a real-life example. Every step along the way, I'll release the Meeting Planner code as open-source examples you can learn from. I'll also address startup-related business issues as they arise.

In the prior episode, I described building the infrastructure for tracking changes to meetings so we would know how to share updates with participants. In this episode, I'll cover monitoring the log and delivering email notifications of changes.

They start with a look at monitoring for updates to current meetings via a "actionFrequent" method and the code required to locate and notify the correct people of the updates. Next up is the logging of these changes to the audit log and pulling a history of the meeting to show what actually changed. Finally there's code to deliver the actual update email.

tagged: build startup series meetingplanner deliver notifications change meeting tutorial

Link: https://code.tutsplus.com/tutorials/building-your-startup-delivering-notifications--cms-26595

Laravel News:
Controller Construct Session Changes in Laravel 5.3
Aug 30, 2016 @ 10:45:13

On the Laravel News site there's a post detailing some of the updates made to session and controller handling in v5.3 of the framework. It mostly revolves around how the middleware handling changed on each request from v5.2.

Back in laravel 5.2, a developer was able to interact with the session directly in a controller constructor. However, this has changed in laravel 5.3.

The difference between how the 5.3 & 5.2 handle an incoming request is that in 5.2 the request goes through 3 pipelines: global, route and controller [...] In 5.3 the request goes through only 2 Pipelines: global and route/controller (in one pipeline).

The post includes a quote from Taylor Otwell (creator and lead developer of the framework) about why this change was made. Then it shows an alternative to directly accessing this session information in your controllers: a Closure-based middleware in the constructor to execute your checks.

tagged: laravel controller session update access middleware change v53

Link: https://laravel-news.com/2016/08/controller-construct-session-changes-in-laravel-5-3/

PHP Roundtable:
042: Staying Relevant For Web Development
Mar 24, 2016 @ 10:56:29

The PHP Roundtable podcast has posted their latest episode - Episode #42: Staying Relevant For Web Development. This time host Sammy K Powers is joined by Matthew Setter, Andy Huggins, Henning Glatter-Götz and Tom Oram.

The technologies that run the web are constantly changing. We discuss strategies for staying on top of the constant flux with continuous learning throughout your career, having mentors, engaging regularly with your peers, contributing to open source projects, voracious reading, and travel to programming events.

You can watch this latest episode either through the embedded video player or directly over on YouTube. Additionally they've also included an audio-only version you can listen to via an in-page audio player. If you enjoy the episode and want to see more, be sure to subscribe to their feed and follow them on Twitter for the latest show announcements.

tagged: phproundtable podcast video ep42 staying relevant change

Link: https://www.phproundtable.com/episode/staying-relevant-in-an-ever-changing-web-development-world