> I think the only way to detect if it can connect to the Internet is to
> see if you can grab a file from somewhere on the Internet. I'd hazard a
> guess that when operating systems are able to tell you they can "connect
> to the Internet" they are actually saying they can ping a predetermined
> remote host. I think checking if PHP can grab a remote file with Curl
> would be sufficient in this case.

Personally, I'd do a DNS lookup - even connecting to a server is a lot more 
overhead than a simple DNS request.  You could force the DNS server to be one 
external to your network - e.g. dig @a.root-servers.net www.google.co.uk.  If 
the dig command fails, you're not connected.

Or just try and get the update anyway - if the download fails, you're not 
connected (or there's something wrong with the update server.)

Reply via email to