Programming

33 articles

Install PHP CodeSniffer with PEAR

This article should be useful for other tools than CodeSniffer. To put some context, I installed PEAR some time ago for PHPUnit, before I read that PHPUnit had moved away from PEAR and can now be installed using Composer or a simple PHAR (PHp ARchive) file. I had troubles with the default PEAR…

How to restore a branch deleted too quickly in Git?

Still not having the automatic reflexes for applying a successful Git branching model, I cleaned up my working repository a little too fast by deleting a hot-fix branch after merging it into the master branch. When I came back to the development branch I was working on before the emergency, I…

Git refusing to delete a remote branch because it is set as current

I wanted to do some clean-up on a remote repository, which contained a lot of obsolete branches. But one of them returned the following error: As this verbose message explains, I was trying to delete the branch named "alpha", which was set as the current branch on the remote repository. It was an…

Git: show all branches on a remote repository

The command below displays all the branches on the remote repository called "origin", including those that are not tracked locally. It also displays local branches configured to be pulled or pushed and their current state. Source To list only the branches that are tracked locally, use:

Execute a specific version of PHP on OVH shared server from command line

The first step is to find the right executable. For example, the default PHP executable is still in version 5.3.16: Other versions are available and we have to specify them explicitly, as we do for Apache through an .htaccess file. My scripts need at least PHP 5.4 and, to use it in CLI, we need the…