Speed up PHP linting with xargs

Most of us use Jenkins to continuously integrate our projects with every commit to the repository, but when it comes with PHP most of the time is spent “linting“.

This action is badly slow and if your project has a lot of files this will take a good percentage of your build time. A really good approach could be executing this task with different files in parallel. For this you can use the powerful xargs command with -P0, which allows xargs to run as many processes as possible at a time.

find codefolder/ -name "*.php" -print0 | xargs -0 -n1 -P0 php -l

So the final snippet for your Ant based project will be:

<target name="lint">
  <exec executable="sh" failonerror="true">
      <arg value="-c" />
      <arg value="find ${project.paths.php.space-separated} -name *.php -print0 | xargs -0 -n1 -P0 php -l"/>

Features that offer value to a minority of users impose a cost on all users.

Douglas Cockford in Javascript: The Good Parts

Setting up Hubot with a gTalk account for fun

This article should be called like something like “Be happy: put a robot in your life”, deep down in order to represent better what I will explain here I’ve changed the title to a more technical point of view.

Since I’ve started to work in Openhost I always thought that for creating a good product our developers (and me between them) should have a great atmosphere, in order to do that I would rather have a pleasant workflow than a strict one. So I’m a firmly believer of Gamification of work. We  were using Jenkins for doing Continuous integration and quickly integrated the Jenkins Continuous Integration Game, a tool which allowed us to create contests for improving our code base without even thinking about it, just thinking on getting a high rate in the contests. But, this is something to another post.

As we are continuously telecommuting, we use groupware chats as our main way of communication. This week I came across to something called Hubot, it’s some sort of chat bot with incredible scriptable capabilities. In a brief description, it is a program that can connect to your groupware chat and it can accept orders, run them in the server and get some response to them in return.

Vagrant logo

Solving caching issues with Vagrant on vboxsf

Since some months I’ve been working with Vagrant as a tool for provisioning my production-like environment to develop Opennemas. Vagrant is a really powerful tool for automating the creation of environment that mimic your production stack without having to deal with configuration files.

In fact this task, automatic provisioning machines, was one of the most important tasks in order to reduce our technical debt. But anyway, let’s move to the topic of this article.

We use Ubuntu OS as a guest VM provisioned by Vagrant+Virtualbox and we share our project code with the guest machine through vboxsf. Inside that machine, among the rest of the stack, it’s running Nginx (but this issue will be present regardless the web server you are running).

Steps toward modernizing a legacy codebase

Paul M Jones presented at the Nashville PHP User Group on August 13th, 2012 on modernizing legacy code.

“We’ve all been there, dropped into a codebase that makes perfect sense to the original developers but might as well be Greek to you. Paul will help you make sense of things with some helpful tips for untangling the spaghetti and how to move it towards a more modern, modular architecture while keeping it running the whole time.”

Page 2 of 23