[imp] Re: Patch for mbox downloads in IMP 3.2.5
Ross Becker
ross at rbecker.org
Mon Sep 13 16:46:50 PDT 2004
Well,
I took a look at things, and I'd have to some major hacking to do
this. Essentially I'd need to add a method to the compression classes
which would accept a filehandle instead of a string, then (ideally),
create a new tmpfile, compress into the new file, and eventually return
the new tmpfile() filehandle.
I think this is actually a good idea anyhow, as anything that's large
enough to warrant being compressed is probably large enough to warrant
not being kept in memory.
I wouldn't mind if someone else were to take this on for the compression
classes, but I may be able to get to it in a reasonable time frame.
Feedback?
--Ross
Jan Schneider wrote:
> Zitat von Ross Becker <ross at rbecker.org>:
>
>> Chuck,
>> I took a look at CVS HEAD code, and I downloaded both imp and horde
>> modules tagged head, and I am unable to locate a file "Compress.php",
>> which is referenced in imp/folders.php. Can you tell me which module
>> this file is located in? It looked like it would have been part of
>
>
> framework
>
>> horde, but "cvs co -r HEAD horde", a find command doesn't locate
>> anything named Compress.php. I'll finish this for IMP 4.x assuming I
>> can locate the compression module.
>>
>> Cheers
>> Ross
>> Chuck Hagenbuch wrote:
>>
>>> Quoting Ross Becker <ross at rbecker.org>:
>>>
>>>> I've patched IMP 3.2.5 to use a tmpfile() stream for generating mboxes
>>>> for download- this way they're automatically removed if the PHP process
>>>> goes away for an unexpected reason. It gets a tmpfile, generates the
>>>> mbox from the folder into that, returns the file handle, then seeks to
>>>> the end and uses ftell() to find the size of the stream, and then does
>>>> 8k blocks to deliver this to the user. This prevents large mail folders
>>>> from blowing up PHP's memory size. I've generated a unified diff of my
>>>> changes- is there any interest in this patch for going into CVS?
>>>
>>>
>>>
>>> It'd be best if it was against CVS HEAD, but it's an interesting
>>> idea. I've been
>>> looking at Zend Download Server as well; I may write a class for
>>> wrapping either
>>> this behavior or ZDS.
>>>
>>> Btw, any reason you didn't use fpassthru()?
>
>
> Jan.
>
> --
> Do you need professional PHP or Horde consulting?
> http://horde.org/consulting/
More information about the imp
mailing list