Re: [PEPr] Comment on PEAR::PEAR_PackageUpdate
| From: | Scott Mattocks | Date: | Wed, 08 Mar 2006 19:45:10 +0000 |
| Subject: | Re: [PEPr] Comment on PEAR::PEAR_PackageUpdate | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41723@lists.php.net to get a copy of this message | ||
Thanks for the feed back Laurent.
Laurent Laville wrote:
1. I think its dangerous to use on windows a preference file named "pear.ini" while you've named it ".ppurc" for other platforms. remember "pear.ini" is default PEAR config file name.Cut and paste mistake. Will fix ASAP. It should be ppurc.ini
2. getPackageInfo() is suppose to return void (see phpdoc), but in real situation it could also return false on error (line 345).getPackageInfo() now returns a boolean in all cases. (docblock fixed also). Actually, I have updated a bunch or other methods and docblocks to have consistent return values also.
3. why don't you used raiseError rather than new PEAR_Error inside
pushError() method ?
It could made it easy with raiseError especially on lines 343-344 and
741-742
to transmit full pear_error instance
if (PEAR::isError($result)) {
$this->pushError($result);
Good idea.
4. Personnaly i prefer to see usage of constant that identify an error and a global mapping for error codes => error messages rather messages all other source code.Another good point. That will help to standardize the error messages also.
5. last you made a typo error in your example (into proposal page and
source code line 57).
if ($ppu->update() {
missing right close parenthesis.
Thank you. Fixed in the proposal and the source.
Thanks again,
--
Scott Mattocks
http://www.crisscott.com