Re: [PEPr] Comment on PEAR::PEAR_PackageUpdate

From: Date: Wed, 08 Mar 2006 18:39:58 +0000
Subject: Re: [PEPr] Comment on PEAR::PEAR_PackageUpdate
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-41722@lists.php.net to get a copy of this message
Last but not least (i've forgotten to said it). It works ! I've updated a PEAR package without problem with just main class and no front end. Laurent Laurent Laville a écrit :
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


« previous php.pear.dev (#41722) next »