We use the PEAR HTTP module to access outside sites. There's a different URL for each mirror; we just use HTTP_Request to pull down the contents. It should be no different than regular web-browsing: connect to port 80, send the magic commands, and read the result from the socket.
We then check for errors, and print warnings if necessary. If there was a problem, we skip the fetch and try to use local files.
Nothing elaborate. When Garvin suspects firewall problems, he sometimes asks you to try this:
Code: Select all
<?php
include('http://www.google.com/');
?>
Put it where you can call it from a browser (like connection_test.php or something), then call it from a browser. If it shows Google, you're not being firewalled. If it doesn't, your Serendipity installation can't connect to the outside world. In that case, you'll have to talk to your provider again. That simplified script should be enough to convince him the problem is on his end, either in his system or the configuration of your account.