[wp-trac] [WordPress Trac] #13307: 3.0 package size will cause memory limit problems

WordPress Trac wp-trac at lists.automattic.com
Tue May 18 14:14:48 UTC 2010


#13307: 3.0 package size will cause memory limit problems
-----------------------------+----------------------------------------------
 Reporter:  nacin            |       Owner:  nacin   
     Type:  defect (bug)     |      Status:  accepted
 Priority:  highest omg bbq  |   Milestone:  3.0     
Component:  General          |     Version:  3.0     
 Severity:  blocker          |    Keywords:          
-----------------------------+----------------------------------------------

Comment(by Otto42):

 This is just a thought, but some of the transports could be optimized.

 The current approach for all of them is to download the entire file into
 memory, then write it out to a file. At least some of the transports have
 ways to do direct file downloads to a file stream instead.

 In the Curl transport, for example, we always use CURLOPT_RETURNTRANSFER,
 to return the data. If we did something like this instead:

 {{{
 $fp = fopen('/some/file/name.zip', 'w');
 $ch = curl_init('http://example.com/whatever');
 curl_setopt($ch, CURLOPT_FILE, $fp);
 ...
 }}}

 Then it would download the file directly to the stream. No memory limit
 issues anymore.

 If the http api had a new method such as, say, get_file(), then we could
 support this sort of thing. And the transports that couldn't do it could
 abstract it using the normal memory download-and-save approach.

 This may not be feasible for 3.0's release, but I think it is the only
 real solution for the long term.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13307#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list