Topic: Alternative for version check
I was messing around, and I realized that it was possible to do the version check with allow_url_fopen disabled using fsockopen.
My code:
if ($action == 'check_upgrade')
{
if (!ini_get('allow_url_fopen'))
{
$latest_version = '';
$fp = @fsockopen("www.punbb.org", 80, $errno, $errstr, 30);
$out = "GET /latest_version HTTP/1.1\r\n";
$out .= "Host: www.punbb.org\r\n";
$out .= "Connection: close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp))
{
$latest_version .= trim(@fread($fp, 128));
}
$latest_version = explode("\n", $latest_version);
$latest_version = array_pop($latest_version);
@fclose($fp);
}
else
{
$fp = @fopen('http://punbb.org/latest_version', 'r');
$latest_version = trim(@fread($fp, 16));
@fclose($fp);
}
Of course, you could use fsockopen for everything to simplify it.