Re: Quick file_get_contents() questions...your opinion needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If you want to use older functions without upgrading your version of PHP, 
try PHP_Compat.

Here's file_get_contents which is comparable in speed to the native version:
http://cvs.php.net/co.php/pear/PHP_Compat/Compat/Function/file_get_contents.php?r=1.19

Most information can be found at http://pear.php.net/php_compat


"Mag" <genphp@xxxxxxxxx> wrote in message 
news:20041011154009.4128.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxx
>
> Hey,
>
>> On Mon, 11 Oct 2004 07:24:03 -0700 (PDT), Mag
>> <genphp@xxxxxxxxx> wrote:
>> > $url=file_get_contents("http://www.yahoo.com/";);
>> >
>> > The thing is, it takes quite some time (2-5 secs)
>> > before the contents are in my program (I am using
>> my
>> > local webserver on my desktop for testing...not a
>> > webserver)
>> >
>> > My questions are for you more experienced guys...
>> > is there anyway to 'quicken' the process or is
>> this
>> > normal?
>> > do you recommend anything other than
>> > file_get_contents() ?
>> > and lastly, is this a resource intensive hog?
>
>
>
>> The 2-5 seconds is most likely a DNS lookup.  You
>> can speed it up by
>> using a local caching DNS server or the IP address,
>> or possibly a DNS
>> server under less load.
>
>
> Thats kind of what I thought, but wanted to confirm.
>
>
>> file_get_contents() is fairly new and and therefore
>> not very backwards
>> compatible with older PHP installs as a result.
>> It's handy and all,
>> but I found our production servers were running a
>> PHP too old to use
>> it one day last week when I tried.
>
> Interesting, so what is more backwards compatable? or
> to put it in another way, what did you change on your
> servers so that your app worked without
> file_get_contents?
>
> Thanks,
> Mag
>
> =====
> ------
> - The faulty interface lies between the chair and the keyboard.
> - Creativity is great, but plagiarism is faster!
> - Smile, everyone loves a moron. :-)
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux