Closed zdanozdan closed 13 years ago
Is there any reason you can't use the adapter? Extending third party classes like that is not all that good, if I would change the internal calls your class would probably break.
Ok the reason is pretty simple. I am using PHP framework which has autoloading turned on. So all php classes are loading automatically as php starts which also includes Mail_Postmark_Adapter from test directory. This is OK (I just forked this lib, I don't care about contents). Now:
So basically all the evil comes from class autoloader.
So solutions are:
Those are not like big issues, just things I run into while developing plugin.
I'm not sure I understand. Is there a Mail_Postmark_Adapter that you haven't written, that you don't want to use? Postmark should only include an interface.
Hi, I am working on PostMark plugin for Symfony framework, and there is a need for class Mail_Postmark to be exteded, but some methods and members are private and IMHO should be protected. For example doing somethng like this is impossible as _apiKey is private and will not be set in parent class. Diff attached.
class sfPostMark extends Mail_Postmark { public function __construct() { $this->_apiKey = sfPostMarkAdapter::getApiKey();
sfPostMarkAdapter::setupDefaults($this); $this->messageHtml(null)->messagePlain(null); }
Tomasz