From: Luke E. <leh...@cs...> - 2000-11-27 18:18:04
|
> Yes, I know this is a very strange idea to be holding function names > in an array. Just an idea. :) A good idea, and probably would work, but I think it's really a round-about way of doing this just to avoid objects. OOP in PHP isn't that bad. The only problem is that it isn't _GOOD_ in the sense that Java has good OOP capabilities. OOP in PHP works sufficiently for what we will need it though, and I think it will be nice clean interface (if we design it properly). This past weekend was pretty boring for me. I was at home with only my parent's Win98 box (YUCK) and a 56k connection that connected at 28.8 usually. Anyway, as such, I developed what I believe to be a good API for the mail interface (I named it sqmail). Attached is the documentation for it. I have also been implementing it using PHP, and it works suprisingly well. Below is some example code of how it would be implemented. --start-- <?php $sqmail = new Sqlib_Mail ($username, $password, $server, $port); $sqmail->select("INBOX"); echo "Number of messages: " . $sqmail->num_messages() . "<br>"; $messages = $sqmail->fetch_brief_headers(); for ($i=0; $i < count($messages); $i++) { echo $messages[$i]->from . ", "; echo $messages[$i]->subject . ", "; echo $messages[$i]->date . "<br>" } $sqmail->close() ?> --end-- And what that would look like (displayed) would be a simple list of all the messages in your INBOX. Take a look at the API documentation. A lot of the ideas have been taken directly from the PHP IMAP documenation to make it easier to implement PHP's IMAP libraries as a separate implemenation. This design is much cleaner than what we currently have... MUCH cleaner. :) Luke _ . . Luke Ehresman - "Codito, ergo sum" / v \ leh...@cs... /( )\ http://www.css.tayloru.edu/~lehresma ^^ ^^ |