Re: cvs: pear /Validate package_AT.xml /Validate/Validate AT.php /Validate/tests validate_AT.phpt
| From: | Gregory Beaver | Date: | Wed, 22 Aug 2007 04:26:15 +0000 |
| Subject: | Re: cvs: pear /Validate package_AT.xml /Validate/Validate AT.php /Validate/tests validate_AT.phpt | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-48485@lists.php.net to get a copy of this message | ||
Ken Guest wrote:
> kguest Tue Aug 21 23:01:09 2007 UTC
>
> Modified files:
> /pear/Validate package_AT.xml
> /pear/Validate/Validate AT.php
> /pear/Validate/tests validate_AT.phpt
> Log:
> Bug #11885 coding standard errors plus DATADIR reference won't work when testing from
> CVS
[snip]
> - $file = '@DATADIR@/Validate_AT/AT_postcodes.txt';
> + if ($dataDir != null && (is_file($dataDir .
> '/AT_postcodes.txt'))) {
> + $file = $dataDir . '/AT_postcodes.txt';
> + } else {
> + $file = '@DATADIR@/Validate_AT/AT_postcodes.txt';
> + }
> $postcodes = array_map('trim', file($file));
Hi Ken,
This is not the best practice. When testing code from CVS, the best way
to do it is have a console window open (or dos box on windows) in which
you have typed:
pear up -f package_AT.xml
in the Validate CVS checkout directory. Then, when you make a change,
hit <up arrow> <enter> and run your examples after your Validate_AT has
updated. With these two additional keystrokes per edit, you can both
ensure your package.xml is valid and that it works as expected from
installation, and remove debugging hacks like the thing above.
Ask on irc if you want more detailed tips on this - I think it's
probably the most important thing I've learned while working in PEAR.
Never run a package off of CVS unless you also intend users to run it
from an unzip-and-go, then you should test both ways when making a change.
Greg