[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-dev
Subject:    [PEAR-DEV] [PEPr] Comment on PHP::Mailman
From:       "Till Klampaeckel" <till () php ! net>
Date:       2011-09-07 18:15:20
Message-ID: 20110907191559.A50BB193A55 () euk1 ! php ! net
[Download RAW message or body]

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

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic