[PEPr] Comment on PHP::Mailman

From: Date: Wed, 07 Sep 2011 19:15:59 +0000
Subject: [PEPr] Comment on PHP::Mailman
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-54489@lists.php.net to get a copy of this message
Hey, a few suggestions: 1) Don't use private, use protected. 2) Update your docblocks (phpdoc.org has a lot of documentation -- e.g. a __construct doesn't return void, it returns the actual class.) 3) Consider ext/dom to parse html (instead of preg_match) 4) Get rid off user_error(): if the error can be neglected. I'd collect them in the class, add hasError(), getError() style methods. If those errors should be addressed, use an exception. 5) Instead of file_get_contents(), use HTTP_Request2 so people can use different transports and customize it, etc.. E.g. right now it's not just hiding possible errors but I'm also unable to use a different extension, proxy or similar. 6) I'd make adminurl and adminpw protected and add set-methods for various reasons: it looks like both require a little validation (e.g., is this a URL, does this password not contain spaces, etc.). Setting the public var could lead to unexpected things. All in all, I like the idea very much. I had the need for something like that a couple times before. Cheers, Till -- http://pear.php.net/pepr/pepr-proposal-show.php?id=665

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