Re: Bug #676: nntp module based on imap module. (fwd)
| From: | (Rasmus Lerdorf) | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Bug #676: nntp module based on imap module. (fwd) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-542@lists.php.net to get a copy of this message | ||
Some input from the IMAP literate is required here.
---------- Forwarded message ----------
Date: Mon, 24 Aug 1998 10:50:47 +1000
From: Gerrit Thomson <334647@swin.edu.au>
To: Rasmus Lerdorf <rasmus@lerdorf.on.ca>
Subject: Re: [PHP-DEV] Bug #676: nntp module based on imap module.
Hi Rasmus,
I agree to use a single module for imap and nntp. I will work on the
threaded sort and let you know how it goes. My problem at the moment is the
desciding how to format the return data.
I am not sure whether to sort a set of headers provided in an arrya to the
routine or to provide a structure containing all the headers in a threaded
structure. The resultant structure I use at the moment in php script is an
array of objects where one of the objects attributes is an array of objects.
I have a feeling that such a comeplex structure would be unusable for the
run of the mill script writers and would require some support functions. This
leads me to the idea of defining a php tree strucure with routines like the
array structure that perform the data insertion and traversing operations.
A tree class could look something like
class tree {
var (object) this_data; # data for this location.
var (object) subtree[]; # array of tree objects .
var (object) leftbranch; # left and right brach poiters for creating a
binary tree.
var (object) rightbranch; # could be done by using subtree[0] for left
and subtree[1] for right.
}
A problem I face with the threaded sort is that the messages that define the
whole depth may not be within the range of the headers supplied or no longer
available from the server. This means that a tree that defines the whole
threaded structure may contain entries for message that either should not or
cannot be retrieved. The message number header attribute could be used with
invalid values to indicate that a location is a placeholder.
So, if you have thoughts on my ramblings I would appreciate it,
Cheers,
Gerrit Thomson.
Rasmus Lerdorf wrote:
> > there are certain thngs applicable only to nntp messages that could be
> > implmented in an nntp module.
> > One routine in particular I am working on is the threading of messages
> > based of the "references" message attribute. I have implemented the
> > algorithm in php3 script but it is far too slow so I will have to
> > re-implement it in c. Although the nntp.c section of the c-client library
> > has an nntp_thread function it performs the sort based on the subject and
> > does not use the "references" or "followup-to" attributes.
>
> That could still be implemented as a separate function that is part of
> imap.c. There is so much code duplication between the two modules that I
> don't think it is worth having two modules here.
>
> -Rasmus
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net