Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.8

Doc Bug #14837 Do not throw exceptions
Submitted: 2008-10-20 15:16 UTC
From: ifeghali Assigned:
Status: Verified Package: System_Command (version 1.0.6)
PHP Version: 5.1.6 OS:
Roadmaps: 1.1.0    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 10 + 18 = ?

 
 [2008-10-20 15:16 UTC] ifeghali (Igor Feghali)
Description: ------------ This package does not throw exceptions like stated in the documentation. It returns PEAR errors instead.

Comments

 [2008-10-20 15:30 UTC] cconstantine (Craig Constantine)
Where "in the documentation" does it say "system_command" throws exceptions? (Because that would be a documenation bug we could look at fixing.) System_Command is *very* old. It uses PEAR error objects, and I can't imagine it will ever be rewritten to throw PHP Exceptions.
 [2008-10-20 16:35 UTC] ifeghali (Igor Feghali)
Please see: http://pear.php.net/package/System_Command/docs/latest/apidoc/System_Command/System_Command.html#methodpushCommand Where you read: "Return: true on success {or System_Command_Error Exception}" I might miss interpreted that sentence but it makes me think it would throw an exception. Also, by "documentation" I meant the source code comments.
 [2008-10-20 17:04 UTC] cconstantine (Craig Constantine)
I see how that code comment could look odd. You can control what happens -- wether trigger_error() is called, an exception is thrown, or the method in question just returns false. The PEAR base class has a mode setting method. http://pear.php.net/package/PEAR/docs/1.7.2/PEAR/PEAR.html#metho dsetErrorHandling So you can do a globally-effective PEAR::setErrorHandling() call to affect all objects which extend the PEAR class, or you can call the setErrorHandling() method on your System_Command object instance to change just it's behaviour. Although I agree the code-comment isn't the greatest, unless you object, I'll mark this bug closed/irrelevant.
 [2008-10-20 17:15 UTC] ifeghali (Igor Feghali)
Hello Craig, Thank you for your answer. I would _suggest_ replacing "exception" in the comments for "PEAR error" just for the sake of not confusing the users. I understand its an old package but its still useful ;) Regards, iGor.
 [2008-10-20 17:22 UTC] cconstantine (Craig Constantine)
code comment is confusing, but not worth rolling a new version. Good 'ol System_Command is in its twilight years. :)
 [2008-10-24 13:38 UTC] cconstantine (Craig Constantine)
will fix/cleanup code comments.
 [2009-05-27 04:40 UTC] doconnor (Daniel O'Connor)
-Type: Bug +Type: Documentation Problem