[PEPr] +1 for Networking::AsteriskManager
| From: | Till Klampaeckel | Date: | Sun, 04 May 2008 12:00:45 +0000 |
| Subject: | [PEPr] +1 for Networking::AsteriskManager | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50004@lists.php.net to get a copy of this message | ||
Till Klampaeckel (http://pear.php.net/user/till) has voted +1 on the proposal for
Networking::AsteriskManager.
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=543
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=543&handle=till
This vote is conditional. The condition is:
* create your own exception class (extending PEAR_Exception)
* use a code when you throw an exception, e.g. implement codes through class constants and e.g. use
self::ERR_NO_SOCKET. this allows people to check what kind of exception they received.
* if i supply auto_connect = false, it would still call connect() (from __construct())
* connect() doesn't return anything (doc problem)
* wrap your "if (!$this->_socket)" into a method and also check if it's a resource
(not just if it's not false)
* instead of fputs(), you should use fwrite() (imho)
* fputs/fwrite can return false, shouldn't that be checked?
* stream_get_contents can also return false
(Maybe wrap those calls into their own method and throw an exception if it doesn't work for
some reason.)
* simplify your if/else (most time the else is not necessary)
* unless PEAR_Exception implements toString(), you will have to do echo $e->getMessage() in your
example
Last but not least, I'd like to see more of the API supported (this can be done on the way to
1.0-stable), regardless - what's your own plan/roadmap for this?
One last suggestion/question - I wonder if it would make sense to subclass e.g. create
Net_AsteriskManager_Queue, Net_AsteriskManager_Sip, *_Zap, *_Monitor, *_Mailbox, etc.. This would
maybe help organize the feature-set, otherwise you end up with a couple dozen methods in
Net_AsteriskManager.
--
Sent by PEPr, the automatic proposal system at http://pear.php.net