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

php[architect]:
July 2016 Issue - Harnessing Magic
Jul 01, 2016 @ 15:48:58

php[architect] Magazine has just published their latest issue for July 2016: Harnessing Magic. This latest issue features articles like:

  • "RegEx is Your Friend" (Liam Wiltshire)
  • "Removing the Magic with Functional PHP" (David Corona)
  • "Implementing Cryptography" (Edward Barnard)
  • "Reference Counting : The PDO Case Study" (Gabriel Zerbib)

There's also all of the usual columns from some of the regular authors, the "Education Station", "Community Corner" and the "Security Corner". If you're interested in the content but just want a sample, be sure to check out this month's free article covering mailing lists and MailChimp. You can pick up either just this issue or a full year subscription directly from the php[architect] website.

tagged: phparchitect phparch magazine magic published released july2016

Link: https://www.phparch.com/magazine/2016-2/july/

SitePoint PHP Blog:
Disco with Design Patterns: A Fresh Look at Dependency Injection
Jul 01, 2016 @ 11:26:44

On the SitePoint PHP blog there's a tutorial posted giving you a "fresh look at dependency injection" using the Disco library from bitExpert.

Dependency Injection is all about code reusability. It’s a design pattern aiming to make high-level code reusable, by separating the object creation / configuration from usage.

[...] Our very own Alejandro Gervasio has explained the DI concept fantastically, and Fabien Potencier also covered it in a series. There’s one drawback to this pattern, though: when the number of dependencies grows, many objects need to be created/configured before being passed into the dependent objects. [...] In this article, we’ll demonstrate the concept [of a dependency injection container] further with a newcomer in this field: Disco.

He starts with the installation of the library via Composer and starting up the built-in PHP web server for testing. With that up and running he shows you how to create an instance of the container and set up a sample service with the configuration in the docblock comments. The tutorial then talks about the service scopes, container parameters and shows it in action to create a simple controller handling frontend. There's a bit more about configuration, the container builder functionality and the creation of a response listener when routes are requested.

tagged: tutorial disco designpattern dependency injection di library

Link: https://www.sitepoint.com/disco-with-frameworks-and-design-patterns-a-fresh-look-at-dependency-injection/

Zend Framework Blog:
Zend Framework 1 End-of-Life Announcement
Jul 01, 2016 @ 10:52:25

On the Zend Framework blog they've posted the announcement about the end of life for Zend Framework v1, the first version of the popular framework.

With the release of Zend Framework 3, it's time to halt development on Zend Framework 1. As such, we hereby announce that Zend Framework 1 reaches its End of Life (EOL) three months from today, on 28 September 2016.

Between now and then, we will only provide security fixes, if any security reports are made in that time frame. Past that point, we will offer custom bug and security fixes for Zend Framework 1 on-demand only to Enterprise users of Zend Server. [...] Additionally, as of today, access to our legacy subversion server is disabled.

You can still get the latest from the package archive, use Composer for updates. There are also services from Zend that can help you update your application as well as two trainings that can help you learn what you need for the upgrade.

tagged: zendframework zendframework1 endoflife announcement project zend

Link: https://framework.zend.com/blog/2016-06-28-zf1-eol.html

Sound of Symfony Podcast:
Episode 14 - What's new in Symfony 3.1
Jul 01, 2016 @ 09:42:36

The Sound of Symfony podcast has posted their latest episode today - Episode #14: What's new in Symfony 3.1 with hosts Magnus Nordlander and Tobias Nyholm.

The band is back together and this time it's a blast from the past. We revisit the old news segment and do a whole show featuring nothing but news. We're talking Symfony 3.1, PHP 7.1 and the fall conference season.

You can listen to this latest episode either using the in-page audio player or by downloading the mp3 directly. If you enjoy the episode, be sure to subscribe to their feed and follow them on Twitter to get the latest updates when new episodes are released.

tagged: soundofsymfony podcast ep14 symfony31 whatsnew

Link: http://www.soundofsymfony.com/episode/episode-14/


Laravel News Podcast:
Episode #20 - With special guest Adam Wathan
Jun 30, 2016 @ 18:20:24

The Laravel News podcast, as hosted by Eric Barnes has posted their latest episode: Episode #20: With special guest Adam Wathan.

In this week’s Laravel News podcast we have Adam Wathan on to talk about his book Refactoring to Collections and a new package MailThief.

You can listen to this latest episode either through the in-page audio player or by subscribing through iTunes or Google Play. There's also a special discount code included for Adam's "Refactoring with Collections" book if you're interested.

tagged: laravelnews podcast ep20 adamwathan laravel collections mailthief

Link: https://laravel-news.com/2016/06/ln-20-special-guest-adam-wathan/

Loïc Faugeron:
Mars Rover, Landing
Jun 30, 2016 @ 17:01:15

Loïc Faugeron has posted the latest part of his "Mars Rover" series documenting the creation of a system to control a rover following the ideas of Monolithic Repositories, Command / Query Responsibility Segregation, Event Sourcing and Test Driven Development (using phpspec). In his previous posts he set up the project and created the package for navigation. in this latest post he gets into the navigation package.

Previously we've created a navigation package, we can now start developing the first use case:

Mars Rovers need first to be landed at a given position. A position is composed of coordinates (x and y, which are both integers) and an orientation (a string being one of north, east, west or south).

He starts off with using the Command Bus pattern to create a command, a handler and a bus that acts on the commands given. True to TDD he starts with the tests and fills in the code to make it all work. This generates the skeleton class for the test which is then filled in with functionality. Running the tests again then has them all passing once a few more changes are made to the internal handling (besides just the basics).

tagged: mars rover landing tutorial monorepo cqrs eventsourcing tdd test phpspec

Link: https://gnugat.github.io/2016/06/29/mars-rover-landing.html

FreeCodeCamp.com:
Bill Sourer - Finding Time to Become a Better Developer
Jun 30, 2016 @ 10:35:48

On the FreeCodeCamp Medium blog Bill Sourer shares some tips you can use to find time to become a better developer in the fast-based, sometimes crazy world of software development.

There’s no time for anything. At least that’s how it feels doesn’t it? No time to learn all the things you think you need to learn to stay ahead of the curve. No time to go back and refactor that ugly piece of code. It works (sort of) and there’s a deadline approaching. No time to write unit tests for everything. No time to write documentation or comments for the next guy who gets stuck maintaining what you wrote. No time to think. No time to breathe. No time!

Well… if you take the time to read this article, I promise you’ll find yourself with more time for what’s important.

He breaks it down into five main tips (here's a tl;dr for those in a rush):

  • You don’t need to learn every new thing in order to stay relevant.
  • Writing good code takes less time than writing bad code, BUT it doesn’t feel that way.
  • Working 24/7 does NOT make you a hero. Managing expectations does.
  • Not all time spent “improving” code has the same ROI.
  • Scheduled down time makes you more productive.

Each item on the list has a paragraph or three explaining it in a bit more detail. There's also some other interesting ideas and thoughts in the comments of the post from other readers.

tagged: better developer time management suggestion tips top5

Link: https://medium.freecodecamp.com/finding-time-to-become-a-better-developer-eebc154881b2#.6ojvwlad0

Freek Van der Herten:
A package to log activity in a Laravel app
Jun 30, 2016 @ 09:46:17

In a new post to his site Freek Van der Herten shares information about a logging package they've developed for Laravel-based applications to make activity logging simpler throughout the app: laravel-activitylog.

n your apps there’s probably a lot going on. Users log in and out, they create, update and delete content, mails get sent and so on. For an administrator of an app these events provide useful insights. In almost every project we make at Spatie we log these events and show them in the admin-section of our site. [...] We made a new package called laravel-activitylog that makes logging activities in a Laravel app a cinch. In this blogpost I’d like to walk you through it.

He then goes through the basics of using the library, complete with code examples:

  • simple activity logging with messaging
  • providing the "acted on" object information
  • logging the information about who the actor was

There's also a section with details on automatic model logging, making it easier to see the changes on you data without having to log each one individually. He also shows you how to use multiple logs, providing a method to narrow down log records by type.

tagged: laravel application logging package example introduction model

Link: https://murze.be/2016/06/package-log-activity-laravel-app/