Jan 8th, 2013
If you're still rooting for windows as your favorite operating system and you're using a lot of cmd.exe and console windows here are some tweaks for you. You should start having fun in the console, because that motivates you to run the tests for you library even more.
For those who did not know, that it is possible to have colors in windows cmd.exe: have look at ansicon. It is really easy to install and does the coloring job. You can tell PHPUnit to switch on the light with setting
colors="true" in your phpunit.xml on the
If you create a shortcut to the cmd.exe you are able to edit the properties of the shortcut. In the tab
layout you're able to adjust the height and width of the window (and the buffer). And you can change color of background and font. Create a funny icon for every of your libraries and use different background colors when you're having a lot of different command windows open.
I use bat files a lot to have all command tools in the global path. Create a directory in your path and add a lot of useful .bat files in it. For example run phpunit:
@ECHO OFF SET BIN_TARGET=%~dp0\"../phpunit/vendor/phpunit/phpunit/composer/bin"\phpunit php "%BIN_TARGET%" %*
I use it to run phpunit from a composer installed vendor directory. The trick used is
%~dp0 which is the directory where the .bat file resides (it's with a trailing backslash).
Do you like a grunt?
@echo off node "C:\Users\Philipp Scheit\AppData\Roaming\npm\node_modules\grunt\bin\grunt" %*
%* delegates all arguments from the .bat file to the called file (in this case to node).
And the last simple one: (How to run composer from a bat file)
@ECHO OFF php %~dp0composer.phar %*
Given that the composer.phar is next to your .bat file.
Another cool tool is go a simple command line util. It needs python to be installed but it has some nice features:
cd D:\www\some\very\long\path go -a abbrev cd D:\www\reset go abbrev REM you are in D:\www\some\very\long\path