Please note that this list may change from time to time as mirrors are added and removed.

"green", "inaccessible" => "red", "outdated" => "orange", "unknown" => "gray", ); $redis = new Redis(); $redis->connect('127.0.0.1', 6379, 2); foreach( $mirrors as $mirrorName => $mirrorInfo ) { $savedResult = $redis->isConnected() ? $redis->get('mirrorStatus-'.$mirrorName) : false; if($savedResult) { $mirrors[$mirrorName]['synctime'] = $savedResult; } else { $cs = curl_init(); curl_setopt( $cs, CURLOPT_URL, $mirrorInfo['url'].'-synctime' ); curl_setopt( $cs, CURLOPT_TIMEOUT, 3 ); curl_setopt( $cs, CURLOPT_HEADER, true ); curl_setopt( $cs, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $cs, CURLOPT_RETURNTRANSFER, true ); $ret = curl_exec( $cs ); curl_close( $cs ); if(!empty( $ret )) { if(!preg_match('#(^|\n)HTTP/1.1 200 OK#', $ret)) { $mirrors[$mirrorName]['synctime'] = '0'; } else { $mirrors[$mirrorName]['synctime'] = strtotime(preg_replace( "#.*\r\n#", '', $ret)); } } else { $mirrors[$mirrorName]['synctime'] = '-1'; } if($redis->isConnected()) { $redis->setEx( 'mirrorStatus-'.$mirrorName, $mirrors[$mirrorName]['synctime'] > 0 ? 1800 : 300, $mirrors[$mirrorName]['synctime'] ); } } } foreach( $mirrors as $mirrorName => $mirrorInfo ) { if( $mirrorInfo['synctime'] < 0 ) { $mirrorStatus = 'inaccessible'; } if( $mirrorInfo['synctime'] == 0 || $mirrors['master']['synctime'] == 0 ) { $mirrorStatus = 'unknown'; } if( $mirrorInfo['synctime'] > 0 ) { $mirrorStatus = ( abs($mirrorInfo['synctime'] - $mirrors['master']['synctime']) > (60*60*30) /* 30 hours */ ? 'outdated' : 'active' ); } if(!isset($_GET['mr'])) { if(isset($statusType[$mirrorStatus])) { $mirrorStatus = ("". $mirrorStatus.""); } echo( "\n". "\n". "\n". "\n"); } else { if($mirrorStatus == 'active') { echo( $mirrorInfo['url']."\n" ); } } } $redis->close(); if(!isset($_GET['mr'])) { ?>
".$mirrorInfo['descr'].": \n". "
".$mirrorInfo['url']."
".$mirrorStatus."