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

SitePoint PHP Blog:
9 Development Workflow Upgrades You Should Know About
Feb 04, 2016 @ 11:39:10

On the SitePoint PHP blog editor Bruno Skvorc shares 9 development workflow upgrades that can help to make you a more efficient (and informed) developer. This is a list of handy tools and changes you can make to current software to help make you more productive.

Every once in a while I run into a tool or plugin so useful I can’t not add it to my arsenal. I usually shout out tweets and try to spread the word that way, but this time I believe I’ve got such a neat (and somewhat random) collection of productivity boosting entries, they deserve a collective article.

Included in his list of helpful tools and tips are things like:

  • git-fresh
  • [Composer changelogs](Composer changelogs)
  • Changing PhpStorm's configuration for faster rendering
  • Parallel downloads [with Composer](Composer parallel downloads)

There's also something he's called the "comfort collection" that can help you and your body feel less of the pains usually associated with long hours in front of the keyboard.

tagged: workflow upgrades development tools configuration tips comfort

Link: http://www.sitepoint.com/9-development-workflow-upgrades-you-should-know-about/

February 2016 Issue Released - "Workflow Powerups"
Feb 02, 2016 @ 12:17:53

php[architect] magazine has officially released their February 2016 issue - "Workflow Powerups" - featuring articles about tools, tips and techniques you can use to enhance your own development workflow.

This issue includes articles like:

  • "Docker for PHP" (Ben Hosmer)
  • "Software Branching Strategies: A Git Overview" (Georgiana Gligor)
  • "Extensible Applications with Symfony Event Dispatcher" (Juan Manuel Torres)

The usual columns are also back: the Education Station, Security Corner and Leveling Up. This month's free article is an interesting one for any one that's submitted to or runs a technical conference: an inside look at how the php[architect] crew makes the talk selections for their conferences. You can get more information about this latest issue and pick up a copy of your own directly from the php[architect] site for just $6.00 USD or a year's subscription for $49.00 USD.

tagged: phparchitect magazine februaru2016 workflow powerup issue release

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

SitePoint PHP Blog:
Look, Ma! No NodeJS! – a PHP front end workflow without Node
Aug 20, 2015 @ 09:26:54

The SitePoint PHP has posted an interesting tutorial describing a Node.js frontend workflow without Node.js, instead using PHP tools to replace the Node.js functionality needed for the build.

If you’re intimidated, exhausted or irritated by Gulp, Grunt, NPM, Yeoman, and all the other NodeJS tools that aim to help but often do the opposite, a good asset management workflow is possible in PHP, and this tutorial aims to prove it. In this article, we’ll go through a NodeJS-free PHP front end asset management setup.

He uses three tools to create the build process: BowerPHP for installing assets, markstory/mini-asset for minification and Robo for automation. He sets up a Homestead virtual machine instance as a testing ground first then creates a basic Slim-based application from the slim3-skeleton package. He gets the necessary tools installed via Composer then gets into the details of the process. He adds (Twitter) Bootstrap into his assets, shows how to set up the minification and creates a Robo task to watch the CSS for any changes. This task then re-runs the minifaction on the CSS and created the condensed version automatically.

tagged: workflow nodejs bowerphp miniasset minification robo task tutorial

Link: http://www.sitepoint.com/look-ma-no-nodejs-a-php-front-end-workflow-without-node/

SitePoint PHP Blog:
Introduction to Chain of Responsibility
Jun 24, 2015 @ 10:26:17

The SitePoint PHP blog has a recent post where they dig into the details of the Chain of Responsibility design pattern, a commonly used structure that makes for easier workflow handling and encapsulation.

The Chain of Responsibility is a behavioral design pattern that processes a request through a series of processor (handlers/receivers) objects. The request is sent from one handler object to another and processed by one (pure implementation) or all of the handlers. All the handlers are part of the chain.

They get into the detail of the parts of the pattern first: the abstract handler that defines the structure and a set of concrete handler classes based on this structure. He also mentions a few other object types that could be involved including a Client, Request and Response objects. He includes an example of the base abstract handler class with "setSuccessor" and "handler" methods to provide the "chain" from one handler to another. He creates a more advanced version of the handler that does some additional checking on the handler results to see if it needs to continue. Finally, he gets down to the Client class that handles the ordering of the chain before processing. He also shows how a service container (dependency injection) could be integrated to manage creating object instances.

tagged: chainofresponsibility designpattern tutorial order workflow

Link: http://www.sitepoint.com/introduction-to-chain-of-responsibility/

Phil Sturgeon:
A Quick Note on PSR Numbering
May 06, 2015 @ 09:41:55

With a lot of talk happening around the PSR-7 HTTP request/response proposal and PSR-4 being the last "official" standard to be posted, some people are wondering what happened to PSR-5 and 6. Phil Sturgeon, a previous member of the PHP-FIG, has posted some clarification to how the PSR process works and where those seemingly missing PSR numbers are at.

The last PSR from the FIG to be sent out into the world, to be used by whoever felt like using it, was PSR-4: Autoloader. Now people are starting to hear about PSR-7, and they’re starting to “lolphp”, wondering what has happened to PSR-5 and PSR-6. [...] This is not like The Neverending Muppet Debate of PHP 6 v PHP 7, despite it being the first though to pop into many peoples heads. Instead, this is down to the Workflow Bylaw I put into place last year.

He goes on to talk about the current workflow stages and how, unlike systems in other languages, the PHP-FIG's process gives proposals a PSR number even before they're published and accepted. He also briefly talks about PSR "nicknames", naming to differentiate between similar proposals and how, despite the need for these names, they're just reference points for conversations more than anything.

tagged: psr7 psr proposal workflow process numbering naming phpfig

Link: https://philsturgeon.uk/php/2015/05/05/psr7-numeric-workflow/

A BDD Workflow With Behat and Phpspec
Jul 04, 2014 @ 14:20:23

NetTuts.com has posted a new tutorial today showing a sample testing BDD workflow using the Behat and PHPSpec testing tools. The BDD (behavior-driven development) approach focuses on using test-driven development and domain-driven design rather than just a unit testing approach.

In this tutorial, we will have a look at two different BDD tools, Behat and phpspec, and see how they can support you in your development process. Learning BDD can be confusing. New methodology, new tools and many questions, such as "what to test?" and "which tools to use?". I hope that this rather simple example will give you ideas to how you can incorporate BDD into your own workflow.

The article isn't a "getting started with BDD" guide, so you'll need to know a bit about the ideas and process before getting into it. He starts with a look at the workflow Taylor Otwell (his inspiration for this) uses and how to install Behat and get to work on a first feature file. He describes the thought process behind the steps and some of the PHP code required to make them work. He then gets to the use of phpspec to mock out a needed "Config" dependency. He works though the rest of the tests and includes the output when all tests are passing.

tagged: bdd workflow phpspec behat taylorotwell tutorial

Link: http://code.tutsplus.com/tutorials/a-bdd-workflow-with-behat-and-phpspec--cms-21601

Phil Sturgeon:
Solving the PHP Internals Workflow
Sep 12, 2013 @ 10:24:56

If you're not a subscriber to the php-internals mailing list, you may not know of several discussions happening right now. On of them relates to how the PHP project is currently run and include suggestions from a wide range of folks for improvements. Phil Sturegon has shared some of his own suggestions in a new post to his site.

On Monday I posted a tale of woe, which like any good tale had a moral at the end. The moral was that while PHP internals has its troubles, the troubles are really being perpetuated by a small few, and there is a clear path to solving the problems. [The PHP-FIG had similar problems and] It soon became incredibly clear that this approach would never work. We needed a workflow, and so does PHP.

He gets into some of the details behind the "growing pains" the PHP-FIG went through before defining their own workflow approach. He points out some of the problems with the workflow on the PHP side (defined here) but suggests that some of it could be avoided with a bit of tweaking. He also points out that the php-internals list "could be awesome" and that steps are already being taken (like improving news.php.net) towards that goal.

tagged: internals workflow phpfig opinion improvement newsphpnet

Link: http://philsturgeon.co.uk/blog/2013/09/solving-the-php-internals-workflow

Jordi Boggiano:
Composer: an update on require-dev
Mar 04, 2013 @ 12:38:33

Jordi Boggiano has a new post to his site about a recent update to the Composer tool that can help make managing development-only dependencies a bit easier.

Using require-dev in Composer you can declare the dependencies you need for development/testing. It works in most simple cases, but when the dev dependencies overlap with the regular ones, it can get tricky to handle. In too many cases it also tends to just fail at resolving dependencies with quite strange error messages. Since this was quite unreliable, I set out to rework the whole feature this week-end. The patch has been merged, and it fixes six open issues which is great.

Additionally, to make it easier to work with the development dependencies, they'll by default be installed when you run an "update" in your repository. If you don't want them, you can still use "--no-dev". Also, Composer will manage them in a seperate section from the normal "require" packages. If you're not using Composer to manage your application's dependencies, look over on getcomposer.org for more details.

tagged: composer requiredev update install workflow nodev dev


Better Workflow in PHP With Composer, Namespacing, and PHPUnit
Jan 21, 2013 @ 10:49:15

On NetTuts.com there's a new screencast posted showing you a good way to create a better workflow in your PHP development using Composer and PHPUnit.

In this video tutorial, we’ll again focus on workflow. Specifically, we’ll use Composer’s built-in autoloading capabilities, along with namespacing, to make for an elegant testing experience. We’ll also review a handful of PHPUnit best practices, as we get setup with these tools.

He shows you how to use Composer to load in the packages from other projects (as well as your own) and using PHPUnit to execute unit tests for your application. He uses test-driven development, but it's not a required part of the workflow. He helps you create a simple "Calculator" test. He also shows how to manually modify the Composer classmap to load in your own classes.

tagged: workflow screencast phpunit composer namespace tdd unittest


Adam Patterson's Blog:
DIY simple staging server.
Oct 21, 2011 @ 10:29:41

Adam Peterson has posted an interesting idea for those out there running an internal staging server they want to constantly keep up to date with the main line of code (without manual intervention) - a git pull web frontend combined with git post-receive hooks.

This [move from svn to git] left a bit of a gap in my process where I could no longer test on a remote server without updating it manually by S/FTP or opening terminal and manually calling a git pull. Open terminal and manually git pull it did break up the work flow a bit so using the Dingo framework I created a very simple Git helper and gave it its own URL something like git/pull.

He added a post-receive hook to his git server that calls this "git/pull" URL on the staging server and updates the code on the server. This provides an easy asynchronous way to update things on another server. Note, though, that this should never be done on a publicly accessible server - it's a pretty large security hole (or at the very least made secure somehow). He used Dingo to create his interface, but something like the Slim micro-framework could have worked just as well. You can view his code on github.

tagged: git pull workflow staging server postreceive hook