cvs: phpweb / mirror-info.php /include site.inc

From: Date: Sun, 08 Jun 2008 19:46:14 +0000
Subject: cvs: phpweb / mirror-info.php /include site.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-1893@lists.php.net to get a copy of this message
bjori Sun Jun 8 19:46:14 2008 UTC Modified files: /phpweb mirror-info.php /phpweb/include site.inc Log: Add more debug info (Still trying to figure out why some mirrors don't like this) http://cvs.php.net/viewvc.cgi/phpweb/mirror-info.php?r1=1.25&r2=1.26&diff_format=u Index: phpweb/mirror-info.php diff -u phpweb/mirror-info.php:1.25 phpweb/mirror-info.php:1.26 --- phpweb/mirror-info.php:1.25 Fri Jun 6 20:38:05 2008 +++ phpweb/mirror-info.php Sun Jun 8 19:46:14 2008 @@ -1,5 +1,5 @@ <?php -// $Id: mirror-info.php,v 1.25 2008/06/06 20:38:05 bjori Exp $ +// $Id: mirror-info.php,v 1.26 2008/06/08 19:46:14 bjori Exp $ // Define $MYSITE and $LAST_UPDATED variables include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; @@ -50,8 +50,9 @@ global $MYSITE; global $LAST_UPDATED, $sqlite, $mirror_stats, $md5_ok; + //$MYSITE = "http://sg.php.net/"; $content = fetch_contents($MYSITE . "manual/noalias.txt"); - if (trim($content) !== 'manual-noalias') { + if (is_array($content) || trim($content) !== 'manual-noalias') { return array( "name" => "Apache manual alias", "see" => $MYSITE . "mirroring-troubles.php#manual-redirect", http://cvs.php.net/viewvc.cgi/phpweb/include/site.inc?r1=1.261&r2=1.262&diff_format=u Index: phpweb/include/site.inc diff -u phpweb/include/site.inc:1.261 phpweb/include/site.inc:1.262 --- phpweb/include/site.inc:1.261 Sat Jun 7 19:13:17 2008 +++ phpweb/include/site.inc Sun Jun 8 19:46:14 2008 @@ -1,6 +1,6 @@ <?php // -*- C++ -*- -// $Id: site.inc,v 1.261 2008/06/07 19:13:17 philip Exp $ +// $Id: site.inc,v 1.262 2008/06/08 19:46:14 bjori Exp $ // Define $MIRRORS array, and some constants include $_SERVER['DOCUMENT_ROOT'] . '/include/mirrors.inc'; @@ -197,6 +197,10 @@ return $http_response_header; } + if (!$data) { + return array("ERROR" => "Unable to find a way to retrieve data with file_get_contents"); + } + return $data; } @@ -221,6 +225,10 @@ } } } + if (!$data) { + return array("ERROR" => "Unable to find a way to retrieve data with curl"); + } + return $data; } @@ -253,6 +261,9 @@ if ($headers) { return $header; } + if (!$data) { + return array("ERROR" => "Unable to find a way to retrieve data with fsockopen"); + } return $data; } @@ -270,6 +281,9 @@ $headers = get_headers($url, 1); } else { $data = fetch_contents($url, true); + if (isset($data["ERROR"])) { + return null; + } foreach($data as $line) { if (($pos = strpos($line, ":")) !== false) { $headers[substr($line, 0, $pos)] = trim(substr($line, $pos+1)); @@ -282,6 +296,7 @@ return null; } if (is_string($header)) { + $header = strtolower($header); $headers = array_change_key_case($headers, CASE_LOWER); }

« previous php.webmaster (#1893) next »