Published at Aug 16, 2014 - 21:16:18 by dixDel
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 configuration and the various steps to add the right folders in the system $PATH, PHP configuration [...] Display full article
Published at Jun 25, 2014 - 12:39:15 by dixDel
Having still not 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.
$ git branch -d hotfix-2014062501
Deleted branch hotfix-2014062501 (was 742134c).
When I came back to the development branch I was working on be [...] Display full article
Published at May 18, 2014 - 19:13:46 by dixDel
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:
$ git push origin :alpha
remote: error: By default, deleting the current branch is denied, because the next
remote: error: 'git clone' won't result in any file checked out, causing confusion.
remote: error: You can set
[...] Display full article
Published at May 18, 2014 - 17:57:32 by dixDel
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.
$ git remote show origin
* remote origin
Fetch URL: my_repository_uri.git
Push URL: my_repository_uri.git
HEAD branch: master
de [...] Display full article
Published at May 17, 2014 - 17:46:15 by dixDel
From time to time, pacman refuses to upgrade because of a file conflict. Since it does not want to take the responsibility of overwriting an existing file which might be used by another package, it displays the following error:
error: failed to commit transaction (conflicting files)
freeimage: /usr/lib/libfreeimageplus.so.3 exists in filesystem
Errors occurred, no
[...] Display full article
Published at May 15, 2014 - 00:00:51 by dixDel
The first step is to find the right executable. For example, the default PHP executable is still in version 5.3.16:
$ php -v
PHP 5.3.16 (cgi-fcgi) (built: Aug 27 2012 17:36:50)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Other versions are available and we have to specify them explicitly, as we do for [...] Display full article
Published at May 11, 2014 - 20:04:08 by dixDel
To add some context, my goal here was to insert a copyright statement at the start of each PHP file present in my working directory. I knew how to replace the content of a file with the sed utility, so I first started to look for a way to read input from a file.
It appears that the GNU version of sed can do it by using the r option, which stands for "read [...] Display full article