mirror of
https://github.com/php/web-php.git
synced 2026-03-23 23:02:13 +01:00
Rework mirrors page:
- Apply coding scheme used on other pages - Add much more information to 'userspace' about mirrors, why they might get delisted, the service they provide, etc. Also more information on the role of the default language. - Depend only on mirror URLs, and the functions now capable of providing information about any mirror given it's URL. This makes this page totally independent on the $MIRRORS array's internal structure. Now it only relies on the fact, that it's an associative array, with the keys as the mirror URLs - Do list special mirrors, but don't list outdated mirrors. This is part of the modifications to move from using the "special mirror" mark to delist a mirror. The new array structure contains the status information now, so we can depend on it. At last, php.net will be listed on php.net as the current mirror, and on other mirror's as being a mirror site.
This commit is contained in:
81
mirrors.php
81
mirrors.php
@@ -1,28 +1,36 @@
|
||||
<?php
|
||||
require_once 'prepend.inc';
|
||||
|
||||
if (isset($FROM) && isset($country)) {
|
||||
header("Location: $country$FROM");
|
||||
exit;
|
||||
}
|
||||
|
||||
include_once 'prepend.inc';
|
||||
commonHeader("Mirror Sites");
|
||||
?>
|
||||
|
||||
<h1>Mirror Sites</h1>
|
||||
|
||||
<p>
|
||||
Here you can find more information about the mirrors of php.net.
|
||||
Here you can find information about the mirrors of php.net. This table only
|
||||
lists the official mirrors, registered in our database. The mirrors automatically
|
||||
detected to be outdated or disfunctional are not listed for your convinience, so
|
||||
there may be a mirror (or some mirrors) with problems in your country additionaly
|
||||
to those listed here. Therefore if you cannot find mirror sites in your country
|
||||
here, or the mirror site you used seems to be disappeared, check back later.
|
||||
</p>
|
||||
<p>
|
||||
Pick a mirror site close to you (the current mirror is highlighted), or visit
|
||||
the provider's homepage. If you are interested in hosting a mirror of this site,
|
||||
<?php print_link("/mirroring.php", "here's how"); ?>.
|
||||
We would like to advice you to choose a mirror site close to use in your
|
||||
everyday work. All mirror sites are expected to provide the same service
|
||||
(with the possible exception of local search support, in which case the
|
||||
main site performs the search). This means that you don't loose anything,
|
||||
if you go with a local mirror site, but you gain speed. The current mirror
|
||||
is highlighted in the list below.
|
||||
</p>
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mirror sites also have default language settings, so shortcut navigation
|
||||
services provide you results in that language. See the
|
||||
<a href="/urlhowto.php">URL shortcuts page</a> for examples of this behaviour.
|
||||
</p>
|
||||
<p>
|
||||
If you are interested in hosting a mirror of this site,
|
||||
<?php print_link("/mirroring.php", "here's how"); ?>.
|
||||
</p>
|
||||
|
||||
<table border="0" cellpadding="2" cellspacing="1" width="100%">
|
||||
<tr bgcolor="#cccccc">
|
||||
<th>Country</th>
|
||||
@@ -31,24 +39,39 @@ the provider's homepage. If you are interested in hosting a mirror of this site,
|
||||
<th>Default Language</th>
|
||||
</tr>
|
||||
<?php
|
||||
$mprevious = 'aa';
|
||||
foreach ($MIRRORS as $murl => $mdata) {
|
||||
if ($mdata[4] != 1) {
|
||||
continue;
|
||||
}
|
||||
echo '<tr bgcolor="' . ($MYSITE==$murl ? '#ffffcc' : '#e0e0e0') . '"><td>';
|
||||
if ($mprevious != $mdata[0]) {
|
||||
echo $COUNTRIES[$mdata[0]];
|
||||
} else {
|
||||
echo " ";
|
||||
|
||||
// Previous mirror country code
|
||||
$prevcc = 'aa';
|
||||
|
||||
// Go through all mirror sites and print out information about them
|
||||
$MURLS = array_keys($MIRRORS);
|
||||
foreach ($MURLS as $murl) {
|
||||
|
||||
// If the mirror is not all right, skip it
|
||||
if (mirror_status($murl) != MIRROR_OK) { continue; }
|
||||
|
||||
// Print out table row, color it specially if current mirror
|
||||
echo '<tr bgcolor="' . ($MYSITE == $murl ? '#ffffcc' : '#e0e0e0') . '"><td>';
|
||||
|
||||
// Check country code, and only print
|
||||
// out country name, if it is a new one
|
||||
$country = mirror_country($murl);
|
||||
if ($prevcc != $country) {
|
||||
echo $COUNTRIES[$country];
|
||||
} else {
|
||||
echo " ";
|
||||
}
|
||||
|
||||
// Print out table cells with mirror information
|
||||
echo '</td><td>' . make_link($murl, $murl) .
|
||||
'</td><td>' . make_link($mdata[3], $mdata[1]) .
|
||||
'</td><td>' . $LANGUAGES[$mdata[6]] . '</td></tr>';
|
||||
$mprevious = $mdata[0];
|
||||
}
|
||||
'</td><td>' . make_link(mirror_provider_url($murl), mirror_provider($murl)) .
|
||||
'</td><td>' . $LANGUAGES[default_language($murl)] . '</td></tr>' . "\n";
|
||||
|
||||
// Preserve previous contry code
|
||||
$prevcc = $country;
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<?php commonFooter(); ?>
|
||||
|
||||
Reference in New Issue
Block a user