Just take is not suffice and sometimes we must give. As a man that living from open source, work with open source software or programming language made me owe too much to open source. So, in 2009 I have make contribution to open source is one of my new year resolution.
Since this February I started to played PHP CodeSniffer. This application is used to check coding standard that currently used of php script, and give report if detects violations of a defined set of coding standards. And to check the script automatically I use phing.
But, I encountered a litle problem when used PHP CodeSniffer with phing. After phing run PHP CodeSniffer, it gives error messages and stop it's process.
Execution of target "phpunit" failed for the following reason: /data1/dolly/ngoprek/php/agile/phing/build.xml:17:38: Directory /data1/php/PHP/CodeSniffer/src/tests not found. BUILD FAILED /data1/dolly/ngoprek/php/agile/phing/build.xml:17:38: Directory /data1/php/PHP/CodeSniffer/src/tests not found.
From the error message above, the next task cannot find it's target because it's path has change. I suspected PHP CodeSniffer has change PHP current path, and make phing given error message above. Then I find chdir() (function that used to change PHP current path) in PHP CodeSniffer library and catched it at CodeSniffer.php on line 153.
To fixed this problem, I made patch for this bug and report to Greg Sherwood, lead developer of PHP CodeSniffer. And he suggest me to report the bug and patch on PHP CodeSniffer Bug Tracker that will be commit to CVS for the next release version.
If you want to update your PHP CodeSniffer 1.1.0 without wait the next release, you can use this patch below.
62a63,68 > /** > * The path that is currently running phpcs command. > * > * @var string > */ > protected $cwd = null; 142a149,150 > $this->cwd = getcwd(); > 1650a1659,1668 > /** > * Destruct PHP_CodeSniffer object. > * > * @return void > */ > public function __destruct() > { > // Change back to directory that run phpcs command > chdir($this->cwd); > }//end __destruct()
Bug tracker for this bug can be reached here.
Comments
Post new comment