com web/master: We don't passively disable mirrors anymore: fetch/mirrors.php

[email protected] (Hannes Magnusson)
Newsgroups php.webmaster
Message-ID <[email protected]>
Commit:    8262baba0faffbc0410b4b9fe11b661d51ffd420
Author:    Hannes Magnusson <[email protected]>         Mon, 27 Apr 2015 22:55:40 +0000
Parents:   7aa7b8815769850d0a4ed2cac4ee2dde5083731e
Branches:  master

Link:       http://git.php.net/?p=web/master.git;a=commitdiff;h=8262baba0faffbc0410b4b9fe11b661d51ffd420

Log:
We don't passively disable mirrors anymore

Changed paths:
  M  fetch/mirrors.php


Diff:
diff --git a/fetch/mirrors.php b/fetch/mirrors.php
index e31a43d..654b9c7 100644
--- a/fetch/mirrors.php
+++ b/fetch/mirrors.php
@@ -44,15 +44,9 @@ if (@mysql_connect("localhost","nobody","")) {
     // Select phpmasterdb database
     if (@mysql_select_db("phpmasterdb")) {
       
-        // Select last mirror check time from table
-        $lct = mysql_query("SELECT UNIX_TIMESTAMP(lastchecked) FROM mirrors ORDER BY lastchecked DESC LIMIT 1");
-        list($checktime) = mysql_fetch_row($lct);
-
         // Select mirrors list with some on-the-fly counted columns
         $res = @mysql_query(
-            "SELECT mirrors.*, country.name AS cname, " .
-            "(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 3 DAY) < mirrors.lastchecked) AS up, " .
-            "(DATE_SUB(FROM_UNIXTIME($checktime), INTERVAL 7 DAY) < mirrors.lastupdated) AS current " .
+            "SELECT mirrors.*, country.name AS cname " .
             "FROM mirrors LEFT JOIN country ON mirrors.cc = country.id " .
             "ORDER BY country.name,hostname"
         );
@@ -86,8 +80,7 @@ if (@mysql_connect("localhost","nobody","")) {
                 // Provide status information for mirrors
                 // computed from current mirror details
                 if (!$row["active"])      { $status = 'MIRROR_NOTACTIVE'; }
-                elseif (!$row["up"])      { $status = 'MIRROR_DOESNOTWORK'; }
-                elseif (!$row["current"]) { $status = 'MIRROR_OUTDATED'; }
+                elseif ($row["ocmt"])     { $status = 'MIRROR_DOESNOTWORK'; }
                 
                 // Print out the array element for this mirror
                 echo "    \"$row[hostname]\" => array(\n" .
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.