cvs: phpweb / mirror-info.php
| From: | Hannes Magnusson | Date: | Thu, 29 Mar 2007 18:24:31 +0000 |
| Subject: | cvs: phpweb / mirror-info.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-34986@lists.php.net to get a copy of this message | ||
bjori Thu Mar 29 18:24:31 2007 UTC
Modified files:
/phpweb mirror-info.php
Log:
Improve the rsync problem detection
- Remove the hardcode filename (now uses the last released php5 .tar.bz2)
- Compare the md5 sum against the registered official md5
http://cvs.php.net/viewvc.cgi/phpweb/mirror-info.php?r1=1.21&r2=1.22&diff_format=u
Index: phpweb/mirror-info.php
diff -u phpweb/mirror-info.php:1.21 phpweb/mirror-info.php:1.22
--- phpweb/mirror-info.php:1.21 Wed Mar 7 21:02:04 2007
+++ phpweb/mirror-info.php Thu Mar 29 18:24:31 2007
@@ -1,17 +1,21 @@
<?php
-// $Id: mirror-info.php,v 1.21 2007/03/07 21:02:04 bjori Exp $
+// $Id: mirror-info.php,v 1.22 2007/03/29 18:24:31 bjori Exp $
// Define $MYSITE and $LAST_UPDATED variables
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
+// Define $PHP_5_VERSION, $PHP_5_MD5 & $RELEASES variables
+include_once $_SERVER['DOCUMENT_ROOT'] . '/include/version.inc';
+
// Text/plain content type for better readability in browsers
header("Content-type: text/plain; charset=utf-8");
// Provide information on local stats setup
$mirror_stats = (int) (isset($_SERVER['MIRROR_STATS']) &&
$_SERVER['MIRROR_STATS'] == '1');
-// Check for an existing exe file (identifies rsync setup problems)
-$exefile = (int) file_exists($_SERVER['DOCUMENT_ROOT'] .
'/distributions/php-5.1.5-installer.exe');
+// MD5 check last release file (identifies rsync setup problems)
+$filename = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' .
$RELEASES[5][$PHP_5_VERSION]["source"][0]["filename"];
+$md5_ok = (int) (file_exists($filename) && md5_file($filename) ==
$PHP_5_MD5["tar.bz2"]);
// Does this mirror have sqlite?
$sqlite = (int) function_exists("sqlite_open");
@@ -24,5 +28,5 @@
$mirror_stats, // 4: Optional local stats support
default_language(), // 5: Mirror language
'manual-noalias', // 6: /manual alias check is done elsewhere now
- $exefile // 7: Rsync setup problems
+ $md5_ok, // 7: Rsync setup problems
));