From 9f3a0d02eb206526aa6ba7cb09f20c2b94709435 Mon Sep 17 00:00:00 2001 From: Romain d'Alverny Date: Fri, 11 Mar 2011 11:27:56 +0000 Subject: mirrors list script --- mirrors.php | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 mirrors.php (limited to 'mirrors.php') diff --git a/mirrors.php b/mirrors.php new file mode 100644 index 000000000..28ae75f18 --- /dev/null +++ b/mirrors.php @@ -0,0 +1,104 @@ + array( + 'Beijing' => array( + 'http://fundawang.lcuc.org.cn/mageia/' + ) + ), + 'Czech Republic' => array( + 'Praha' => array('http://mageia.supp.name/') + ), + 'Deutschland' => array( + 'Erfurt' => array( + 'http://ftp.mandrivauser.de/mirrors/Mageia/', + 'ftp://ftp.mandrivauser.de/mirrors/Mageia/' + ), + 'Erlangen' => array( + 'http://ftp.uni-erlangen.de/mirrors/Mageia/', + 'ftp://ftp.uni-erlangen.de/mirrors/Mageia/' + ), + 'Esslingen' => array( + 'http://ftp-stud.hs-esslingen.de/pub/Mirrors/Mageia/', + 'ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/Mageia/' + ) + ), + 'France' => array( + 'Paris' => array( + 'http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/', + 'ftp://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/' + ) + ), + 'Schweitz' => array( + 'Lucern' => array( + 'ftp://ftp.LinuxCabal.org/pub/mirrors/Mageia/' + ) + ), + 'Nouvelle Calédonie' => array( + 'Nouméa' => array( + 'http://mageia.nautile.nc/mageia/distrib/' + ) + ), + 'USA' => array( + 'Durham' => array( + 'ftp://distro.ibiblio.org/pub/linux/distributions/mageia/', + 'http://distro.ibiblio.org/pub/linux/distributions/mageia/' + ) + ) +); + +// update this list +$headers = array( + 'en' => array('Location', 'Protocol', 'Server'), + 'de' => array('Ort', 'Protokoll', 'Server'), + 'el' => array('Τοποθεσία', 'Πρωτόκολλο', 'Εξυπηρετητής'), + 'et' => array('Asukoht', 'Protokoll', 'Serveur'), + 'fr' => array('Emplacement', 'Protocole', 'Serveur'), + 'it' => array('Posizione', 'Protocollo', 'Server'), + 'pl' => array('Położenie', 'Protokół', 'Serwer'), + 'pt' => array('Localização', 'Protocolo', 'Servidor'), + 'ro' => array('Locație', 'Protocol', 'Server'), + 'ru' => array('Расположение', 'Протокол', 'Сервер'), + 'tr' => array('Yer', 'Protokol', 'Sunucu'), + 'zh-tw' => array('位置', '協定', '伺服器'), + +); +$hl = array_key_exists($locale, $headers) ? $locale : 'en'; + +$s = ''; +foreach ($mirrors as $country => $cities): + $s_cities = ''; + $rowspan = 0; + foreach ($cities as $city => $servers): + $s_mirrors = ''; + foreach ($servers as $url): + $pu = parse_url($url); + $s_mirrors .= sprintf('%s%s', + strtoupper($pu['scheme']), + $url, 'iso/', $pu['host']); + endforeach; + $s_cities .= sprintf('%s', + count($servers), $city) . $s_mirrors; + + $rowspan += count($servers); + endforeach; + + $s .= sprintf('%s', + $rowspan, $country) . $s_cities; +endforeach; + +$th = array('', '', + sprintf('%s%s%s', + $headers[$hl][0], + $headers[$hl][1], + $headers[$hl][2]), + '', ''); + +echo '
', implode($th), ''; +echo $s; +echo '
'; + -- cgit v1.2.1