[PEPr] Comment on PEAR::PEAR_PackageUpdate
| From: | Laurent Laville | Date: | Wed, 08 Mar 2006 18:35:44 +0000 |
| Subject: | [PEPr] Comment on PEAR::PEAR_PackageUpdate | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41721@lists.php.net to get a copy of this message | ||
Laurent Laville (http://pear.php.net/user/farell) has commented on the proposal for
PEAR::PEAR_PackageUpdate.
Comment:
Here are my latest comments, while looking deeper into source code.
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.
2. getPackageInfo() is suppose to return void (see phpdoc), but in real
situation it could also return false on error (line 345).
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);
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.
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.
Hope it will help and you understood me.
Laurent
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=369
--
Sent by PEPr, the automatic proposal system at http://pear.php.net