|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-03-27 01:55 UTC] jpaulomf at terra dot com dot br
When tring to open a file for remote edition like:
$file = file("http://myaddress.com/users.php?op=xz&f=w");
Whe can't set the headers.
And why one would like to?
1 - Readfile throws the content to std out.
2 - fsockopen takes too much time to do the same:
$sck = fsockopen($host,$port,&$errno,&$errstr);
fputs($sck,$request);
while(!feof($sck)) {
$result .= fgets($sck,128);
}
This will take about 300-400% more time compared with file() or readfile(). (WHY??? Ive tested the int lenght of fgets() with 2,32,64,128...4096 and it is still very slow: filesizes > 400kb ~ 90-120 sec (@ 256k) when file() does the same in ~ 20-30 sec).
I've not tested cURL yet, but I think PHP should support this w/o 3 parties..
Thanks ppl!
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jan 05 13:00:02 2026 UTC |
We should able to set the headers sent by file() and fopen-wrappers when the requests are made to outside, like: $file = fopen("http://myaddress.com/blah.php?op=po");AND: $file = file("http://myqddress.com/foo.htm"); $file = readfile("http://myaddress.com/foo.htm"); and what I told you before was that the other options we have to send our own defined headers(fsockopen) are too slow. What I'm asking is to have the ability to set the headers of file(), readfile() and fopen().