IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New I'd be rethinking the algorithm at this point.
PHP's classes are quite classical in most ways. Dynamic inheritance is the province of prototyping languages, such as JavaScript.

Why do you need to modify the object that Pear::Mail returns? What does it need to do that it can't currently do?

You could create your own mail class which which either extends off Pear::Mail, or more likely stands outside it. You'd then need to build methods encapsulating how you want to call an email API and that does the calls to Pear::Mail. (I always end up doing this kind of thing for database access.)

Wade.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
New Need to add logging
I drop records in a queue saying "Send message 32 to user 495 at 11:00 AM on 2/24/2010". New records default their status to "pending".

When the queue processor runs, it grabs batches and updates status to "processing", then as it sends each one it changes the status to "sent", and sets the time that it was sent.

Right now, the "send" command is in a static lib, which instantiates the Mail class to send. So I'm creating a new instance for each message sent, which is typically 100 per run. I was thinking last night it would make more sense to extend the mail class instead, so there's just one instance, and just call the "send" method in the loop. I can also tie the status updates to the send method.

===

Hmm, just realized the PEAR guys had the same problem. The Mime class should really be an extension of the Mail class, but you can't make that work with the Mail factory.

I'll just keep my Message class static, and declare the Mail class static, too, so I don't keep recreating it.
--

Drew
Expand Edited by drook Jan. 30, 2010, 10:07:14 AM EST
Expand Edited by drook Jan. 30, 2010, 10:08:17 AM EST
New Sounds like you have a solution.

Q:Is it proper to eat cheeseburgers with your fingers?
A:No, the fingers should be eaten separately.
     Can you extend a class created via factory? - (drook) - (3)
         I'd be rethinking the algorithm at this point. - (static) - (2)
             Need to add logging - (drook) - (1)
                 Sounds like you have a solution. -NT - (static)

This is actually a variation of the phrase, "HEY MOE."
65 ms