1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Remove references, redirects, and selection of mirrors

This commit is contained in:
Derick Rethans
2019-03-29 12:20:01 +00:00
parent 8621612ca5
commit b2b48ca1e0
20 changed files with 69 additions and 1033 deletions

View File

@@ -14,7 +14,7 @@ $_SERVER['BASE_PAGE'] = 'cached.php';
include_once 'include/prepend.inc';
if (!isset($_GET["f"])) {
header("Location: http://php.net/");
header("Location: https://www.php.net/");
exit;
}
$pwd = realpath($_SERVER["DOCUMENT_ROOT"]);
@@ -22,7 +22,7 @@ $abs = $pwd. "/" .(string)$_GET["f"];
$abs = realpath($abs);
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
header("Location: http://php.net/" . strtr($_GET["f"],array("\r"=>"","\n"=>"")));
header("Location: https://www.php.net/" . strtr($_GET["f"],array("\r"=>"","\n"=>"")));
exit;
}

View File

@@ -109,7 +109,7 @@ foreach ($LANGUAGES as $langcode => $language) {
if (file_exists($filepath)) {
// Mirror selection download URL
$link_to = "/get/$filename/from/a/mirror";
$link_to = "/distributions/manual/$filename";
// Try to get size and changed date
$size = @filesize($filepath);
@@ -151,7 +151,7 @@ if (file_exists($actual_file)) {
}}} */
if (count($found_formats) == 0) {
echo "<p class=\"tip\">This mirror has no documentation files for download.</p>";
echo "<p class=\"tip\">This site has no documentation files for download.</p>";
} else {
echo '<table border="0" cellpadding="4" cellspacing="2" class="standard">' . "\n" .

View File

@@ -37,7 +37,7 @@ if ($URI == 'phpnetimprovedsearch.src') {
// ============================================================================
// BC: handle bugs.php moved completely to bugs.php.net
if (preg_match("!^bugs.php\\?(.+)$!", $URI, $array)) {
mirror_redirect("http://bugs.php.net/?$array[1]");
mirror_redirect("https://bugs.php.net/?$array[1]");
}
// ============================================================================
@@ -140,18 +140,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) {
$df = str_replace("7-LATEST", $PHP_7_VERSION, $df);
}
// Mirror selection page
if ($dlinfo[2] == "a") {
status_header(200);
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/get-download.inc";
exit;
}
// The same mirror is selected
if ($dlinfo[2] == "this") { $mr = $MYSITE; }
// Some other mirror is selected
else { $mr = "http://{$dlinfo[2]}/"; }
$mr = "https://www.php.net/";
// Check if that mirror really exists if not, bail out
if(!isset($MIRRORS[$mr])) {

View File

@@ -67,7 +67,6 @@
<li><a href="/my.php">My PHP.net</a></li>
<li><a href="/contact.php">Contact</a></li>
<li><a href="/sites.php">Other PHP.net sites</a></li>
<li><a href="/mirrors.php">Mirror sites</a></li>
<li><a href="/privacy.php">Privacy policy</a></li>
</ul>
</div>

View File

@@ -32,8 +32,8 @@ $size = 0;
// No downloadable file found
if ($file === FALSE) {
$info = "<p>
The file you requested (<strong> " . htmlspecialchars($df, ENT_QUOTES, "UTF-8") . " </strong>) is not found on
this server (<strong>{$MYSITE}</strong>). Please try another mirror listed below</p>";
The file you requested (<strong>" . htmlspecialchars($df, ENT_QUOTES, "UTF-8") . "</strong>) is not found on
this server (<strong>{$MYSITE}</strong>).</p>";
echo <<<EOT
<h1>Download not found</h1>
@@ -44,32 +44,8 @@ EOT;
$local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $file;
// Try to get filesize to display
$size = @filesize($local_file);
?>
<h1>Choose mirror site for download</h1>
<p>
You have chosen to download the following file:
<span class="download-file">
<strong class="filename"><?php echo $df ?>
</strong>
<?php
if ($size) {
echo '<small>(' . number_format($size, 0, '.', ',') . ' bytes)</small>';
}
?>
</span>
</p>
<?php
}
?>
<div class="mirrors-list">
<?php print_full_mirror_list($df, $size); ?>
</div>
</div>

View File

@@ -62,7 +62,7 @@ if (!isset($config["languages"])) {
<link rel="alternate" type="application/atom+xml" href="<?php echo $MYSITE ?>feed.atom" title="PHP: Hypertext Preprocessor">
<?php if (isset($_SERVER['BASE_PAGE'])): ?>
<link rel="canonical" href="http://php.net/<?php echo $_SERVER['BASE_PAGE']?>">
<link rel="canonical" href="https://www.php.net/<?php echo $_SERVER['BASE_PAGE']?>">
<?php if ($shortname): ?>
<link rel="shorturl" href="<?php echo $shorturl ?>">
<link rel="alternate" href="<?php echo $shorturl ?>" hreflang="x-default">

View File

@@ -181,13 +181,7 @@ function print_popup_link($url, $linktext=false, $windowprops="", $target=false,
// Print a link for a downloadable file (including filesize)
function download_link($file, $title, $showsize = TRUE, $mirror = '')
{
// Construct the download link for this site or a mirror site
$download_link = "get/$file/from/a/mirror";
if ($mirror != '') {
$download_link = $mirror . $download_link;
} else {
$download_link = "/" . $download_link;
}
$download_link = "/distributions/" . $file;
// Print out the download link
print_link($download_link, $title);
@@ -204,12 +198,7 @@ function download_link($file, $title, $showsize = TRUE, $mirror = '')
if(@file_exists($local_file.".asc")) {
echo " ";
$sig_link = "get/$file.asc/from/a/mirror";
if ($mirror != '') {
$sig_link = $mirror . $sig_link;
} else {
$sig_link = "/" . $sig_link;
}
$sig_link = "/distributions/$file.asc";
print_link($sig_link, "(sig)");
}
@@ -518,7 +507,7 @@ function site_header($title = '', $config = array())
// shorturl; http://wiki.snaplog.com/short_url
if (isset($_SERVER['BASE_PAGE']) && $shortname = get_shortname($_SERVER["BASE_PAGE"])) {
$shorturl = "http://php.net/" . $shortname;
$shorturl = "https://www.php.net/" . $shortname;
}
require __DIR__ ."/header.inc";

View File

@@ -20,48 +20,8 @@ function load_check()
header("X-PHP-Load: " . implode(", ", $load));
$load = $load[0];
// Load is very high, we won't even redirect
// Load is very high
if ($load > 80) { load_toobusy(); }
// Adhere to user preferences if valid
$user_mirror = myphpnet_mirror();
if (isset($MIRRORS[$user_mirror]) && $MIRRORS[$user_mirror][7] == MIRROR_OK
&& $user_mirror != "http://php.net/" && $user_mirror != 'http://www.php.net/') {
header("Location: $user_mirror" . substr($_SERVER['REQUEST_URI'], 1));
exit;
}
$close_mirrors = array();
$other_mirrors = array();
// Find potential close mirrors
foreach ($MIRRORS as $murl => $mirror) {
if ($murl != 'http://php.net/' && $murl != 'http://www.php.net/' && $mirror[7] == MIRROR_OK && $mirror[4] != MIRROR_SPECIAL) {
if ($mirror[0] == $COUNTRY) {
$close_mirrors[] = $murl;
} else {
$other_mirrors[] = $murl;
}
}
}
$need_mirror = TRUE;
// Randomly pick one of the close mirrors
if (count($close_mirrors) > 0) {
if (!load_random_redirect($close_mirrors)) {
$need_mirror = FALSE; // selected the same site
}
}
// Pick a random mirror if load is moderate
if ($need_mirror && $load > 10 && count($other_mirrors) > 0) {
load_random_redirect($other_mirrors);
}
// No mirror was found, allow the request
// through if the load isn't really really high
if ($load > 20) { load_toobusy(); }
}
// Send reply to the client that we are too busy now
@@ -72,16 +32,4 @@ function load_toobusy()
exit;
}
// Redirect to the same page on $mirror site
function load_random_redirect($mirrors)
{
global $MYSITE;
$murl = $mirrors[array_rand($mirrors)];
if ($murl != $MYSITE) {
header("Location: $murl" . substr($_SERVER['REQUEST_URI'], 1));
exit;
} else { return FALSE; }
}
load_check();

View File

@@ -1,414 +0,0 @@
<?php
/*
* DO NOT MODIFY THIS FILE
* This file is automagically generated, and overwritten,
* by the rsync box. It is only included in this repo to simplify getting
* up and running on your localhost without needing to generate all this
* yourself from master.
*/
/*
Structure of an element of the $MIRRORS array:
0 Country code
1 Provider name
2 Local stats flag (TRUE / FALSE)
3 Provider URL
4 Mirror type [see type constants]
5 SQLite availability [was originally: local search engine flag] (TRUE / FALSE)
6 Default language code
7 Status [see status constants]
List generated: 2013/09/19 23:59:07 GMT
*/
// Mirror type constants
define('MIRROR_DOWNLOAD', 0);
define('MIRROR_STANDARD', 1);
define('MIRROR_SPECIAL', 2);
define('MIRROR_VIRTUAL', 3);
// Mirror status constants
define('MIRROR_OK', 0);
define('MIRROR_NOTACTIVE', 1);
define('MIRROR_OUTDATED', 2);
define('MIRROR_DOESNOTWORK', 3);
$MIRRORS = array(
"http://ar2.php.net/" => array(
"ARG", "XMundo Hosting Solutions", FALSE,
"http://www.xmundo.net", MIRROR_STANDARD, TRUE,
"es", MIRROR_OK),
"http://am1.php.net/" => array(
"ARM", "ARMINCO Global Telecommunications", TRUE,
"http://www.arminco.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://au1.php.net/" => array(
"AUS", "UberGlobal", TRUE,
"http://www.uber.com.au/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://at1.php.net/" => array(
"AUT", "Goodie Domain Service", FALSE,
"http://www.gdsw.at/", MIRROR_STANDARD, TRUE,
"de", MIRROR_OK),
"http://at2.php.net/" => array(
"AUT", "Yalwa Local Directory Services Austria", TRUE,
"http://www.yalwa.at/", MIRROR_STANDARD, TRUE,
"de", MIRROR_OK),
"http://bd1.php.net/" => array(
"BGD", "IS Pros Limited", TRUE,
"http://www.ispros.com.bd", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://be1.php.net/" => array(
"BEL", "King Foo", FALSE,
"http://www.king-foo.be/", MIRROR_STANDARD, TRUE,
"nl", MIRROR_OK),
"http://be2.php.net/" => array(
"BEL", "Cu.be Solutions", TRUE,
"http://www.cu.be/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://br1.php.net/" => array(
"BRA", "HostNet Internet", FALSE,
"http://www.hostnet.com.br", MIRROR_STANDARD, TRUE,
"pt_BR", MIRROR_OK),
"http://br2.php.net/" => array(
"BRA", "Digirati Internet", FALSE,
"http://www.digirati.com.br/", MIRROR_STANDARD, TRUE,
"pt_BR", MIRROR_OK),
"http://bg2.php.net/" => array(
"BGR", "Data.BG", TRUE,
"http://www.data.bg", MIRROR_STANDARD, TRUE,
"bg", MIRROR_OK),
"http://ca1.php.net/" => array(
"CAN", "easyDNS", FALSE,
"http://www.easydns.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ca2.php.net/" => array(
"CAN", "Parasane, LLC", TRUE,
"http://www.parasane.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ca3.php.net/" => array(
"CAN", "egateDOMAINS", TRUE,
"http://www.egatedomains.ca/?RP=DJFEIWHFEWQ", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://cl1.php.net/" => array(
"CHL", "Caos Consultores", TRUE,
"http://www.caos.cl", MIRROR_STANDARD, TRUE,
"es", MIRROR_OK),
"http://cn1.php.net/" => array(
"CHN", "VeryCD Network", FALSE,
"http://www.verycd.com", MIRROR_STANDARD, FALSE,
"", MIRROR_DOESNOTWORK),
"http://cn2.php.net/" => array(
"CHN", "Sina App Engine (SAE)", TRUE,
"http://sae.sina.com.cn/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://cz1.php.net/" => array(
"CZE", "Czech Technical University in Prague", FALSE,
"http://www.cvut.cz/", MIRROR_STANDARD, TRUE,
"cs", MIRROR_OK),
"http://cz2.php.net/" => array(
"CZE", "Softaculous Ltd.", TRUE,
"http://www.softaculous.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://dk1.php.net/" => array(
"DNK", "Siminn Denmark", TRUE,
"http://www.siminn.dk", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ee1.php.net/" => array(
"EST", "Zone Media LLC", TRUE,
"https://www.zone.ee/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://fi1.php.net/" => array(
"FIN", "Avenla Oy", TRUE,
"http://www.avenla.fi/", MIRROR_STANDARD, TRUE,
"fi", MIRROR_OK),
"http://fi2.php.net/" => array(
"FIN", "Planeetta Internet OY", TRUE,
"http://www.planeetta.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://fr2.php.net/" => array(
"FRA", "Crihan", FALSE,
"http://www.crihan.fr/", MIRROR_STANDARD, TRUE,
"fr", MIRROR_OK),
"http://de1.php.net/" => array(
"DEU", "@GLOBE GmbH", FALSE,
"http://www.globe.de/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://de2.php.net/" => array(
"DEU", "Locanto Kleinanzeigen", TRUE,
"http://www.locanto.de/", MIRROR_STANDARD, TRUE,
"de", MIRROR_OK),
"http://de3.php.net/" => array(
"DEU", "1&1 Internet AG", FALSE,
"http://1und1.de", MIRROR_STANDARD, TRUE,
"de", MIRROR_OK),
"http://gr2.php.net/" => array(
"GRC", "Golden-i", TRUE,
"http://www.golden-i.gr/", MIRROR_STANDARD, TRUE,
"el", MIRROR_OK),
"http://hk1.php.net/" => array(
"HKG", "Nethub Online Limited", FALSE,
"http://www.nethub.com.hk/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://hk2.php.net/" => array(
"HKG", "Website Solution Web Hosting", FALSE,
"http://www.website-solution.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://hu1.php.net/" => array(
"HUN", "PHPhost.hu", FALSE,
"http://www.phphost.hu", MIRROR_STANDARD, TRUE,
"hu", MIRROR_OK),
"http://is1.php.net/" => array(
"ISL", "Netsamskipti ehf", TRUE,
"http://www.nwc.is", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://is2.php.net/" => array(
"ISL", "Dotgeek", TRUE,
"http://dotgeek.org/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://in1.php.net/" => array(
"IND", "Directi Web Hosting", FALSE,
"http://www.directi.com", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://in2.php.net/" => array(
"IND", "Directi Web Hosting", FALSE,
"http://www.directi.com", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://in3.php.net/" => array(
"IND", "IndiaLinks Web Hosting Pvt Ltd", TRUE,
"http://www.indialinks.com", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://id1.php.net/" => array(
"IDN", "PT Pasifik Satelit Nusantara", TRUE,
"http://www.pesat.net.id", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ir2.php.net/" => array(
"IRN", "ParsPack.com", FALSE,
"http://parspack.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ie1.php.net/" => array(
"IRL", "Yalwa - Local Directory Services Ireland", TRUE,
"http://www.yalwa.ie/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://il1.php.net/" => array(
"ISR", "SPD HOSTING LTD", FALSE,
"http://www.spd.co.il/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://it1.php.net/" => array(
"ITA", "Register.it", FALSE,
"http://www.register.it/", MIRROR_STANDARD, TRUE,
"it", MIRROR_OK),
"http://it2.php.net/" => array(
"ITA", "nidohosting", FALSE,
"http://www.nidohosting.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://jm2.php.net/" => array(
"JAM", "Teamopolis Sports Websites Inc.", TRUE,
"http://www.teamopolis.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://jp1.php.net/" => array(
"JPN", "PacketBusiness, Inc.", FALSE,
"http://www.packetbusiness.com/", MIRROR_STANDARD, TRUE,
"ja", MIRROR_OK),
"http://jp2.php.net/" => array(
"JPN", "snotch", TRUE,
"http://bloggers.ja.bz/sunouchi/", MIRROR_STANDARD, TRUE,
"ja", MIRROR_OK),
"http://lv1.php.net/" => array(
"LVA", "Amigo", TRUE,
"http://www.amigo.lv/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://li1.php.net/" => array(
"LIE", "Telecom Liechtenstein AG", TRUE,
"http://www.telecom.li/", MIRROR_STANDARD, TRUE,
"de", MIRROR_OK),
"http://lu1.php.net/" => array(
"LUX", "root eSolutions ISP", FALSE,
"http://www.root.lu", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://my1.php.net/" => array(
"MYS", "MaxDedicated", TRUE,
"http://www.maxdedicated.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://mx1.php.net/" => array(
"MEX", "uServers Mexico", FALSE,
"http://www.uservers.net/?in=php", MIRROR_STANDARD, TRUE,
"es", MIRROR_OK),
"http://mx2.php.net/" => array(
"MEX", "Universidad Autónoma Metropolitana Azcapotzalco", TRUE,
"http://www.azc.uam.mx", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://nl1.php.net/" => array(
"NLD", "Stream Service", TRUE,
"http://www.streamservice.nl/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://nl3.php.net/" => array(
"NLD", "Computel Standby BV", TRUE,
"http://www.computel.nl/", MIRROR_STANDARD, TRUE,
"nl", MIRROR_OK),
"http://nc1.php.net/" => array(
"NCL", "Nautile", TRUE,
"http://www.nautile.nc/", MIRROR_STANDARD, TRUE,
"fr", MIRROR_OK),
"http://nz1.php.net/" => array(
"NZL", "Simon Sites", TRUE,
"http://simonsites.geek.nz/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://nz2.php.net/" => array(
"NZL", "Catalyst IT Ltd", FALSE,
"http://catalyst.net.nz/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://no1.php.net/" => array(
"NOR", "Nordicom Norge AS", FALSE,
"http://nordicom.no/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://no2.php.net/" => array(
"NOR", "Verdens Gang AS", TRUE,
"http://www.vg.no", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://pk1.php.net/" => array(
"PAK", "MAGSNET LIMITED", FALSE,
"http://magsnet.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://pa1.php.net/" => array(
"PAN", "Unidominios", TRUE,
"http://www.unidominios.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://pl1.php.net/" => array(
"POL", "WEBdev", TRUE,
"http://webdev.pl/", MIRROR_STANDARD, TRUE,
"pl", MIRROR_OK),
"http://pt1.php.net/" => array(
"PRT", "nfsi telecom, lda", FALSE,
"http://www.nfsi.pt/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://pt2.php.net/" => array(
"PRT", "dominios.pt", TRUE,
"http://www.dominios.pt/", MIRROR_STANDARD, TRUE,
"pt", MIRROR_OK),
"http://kr1.php.net/" => array(
"KOR", "ask.sarang.net", TRUE,
"http://ask.sarang.net", MIRROR_STANDARD, TRUE,
"kr", MIRROR_OK),
"http://md1.php.net/" => array(
"MDA", "dev.md", FALSE,
"http://www.dev.md/", MIRROR_STANDARD, TRUE,
"ro", MIRROR_OK),
"http://ro1.php.net/" => array(
"ROU", "SpiderVPS", FALSE,
"http://www.spidervps.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ru2.php.net/" => array(
"RUS", "Cronyx Plus LLC", FALSE,
"http://isp.rinet.ru/", MIRROR_STANDARD, TRUE,
"en", MIRROR_DOESNOTWORK),
"http://sg2.php.net/" => array(
"SGP", "Xssist Group (Singapore) Pte Ltd", FALSE,
"http://www.xssist.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://sg3.php.net/" => array(
"SGP", "NamesAhead.com", TRUE,
"http://www.namesahead.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://si1.php.net/" => array(
"SVN", "DOMENAR.net", FALSE,
"http://www.domenar.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://es1.php.net/" => array(
"ESP", "GRN Serveis Telematics", FALSE,
"http://www.grn.es/classic", MIRROR_STANDARD, TRUE,
"es", MIRROR_OK),
"http://se1.php.net/" => array(
"SWE", "Portlane AB", FALSE,
"http://www.portlane.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://se2.php.net/" => array(
"SWE", "SpaceDump IT AB", TRUE,
"http://www.spacedump.se/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ch1.php.net/" => array(
"CHE", "ComunidadHosting", TRUE,
"http://www.comunidadhosting.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ch2.php.net/" => array(
"CHE", "Jobsuchmaschine AG", FALSE,
"http://www.jobsuchmaschine.ch/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://tw1.php.net/" => array(
"TWN", "twemail.com", TRUE,
"http://twemail.com/", MIRROR_STANDARD, TRUE,
"tw", MIRROR_OK),
"http://tw2.php.net/" => array(
"TWN", "www.mirror.tw", TRUE,
"http://www.mirror.tw/", MIRROR_STANDARD, TRUE,
"tw", MIRROR_OK),
"http://th1.php.net/" => array(
"THA", "THAIWEB.network", TRUE,
"http://www.thaiweb.net", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://tr1.php.net/" => array(
"TUR", "İstanbul Teknik Üniversitesi Bilgi İşlem Daire Başkanlığı", FALSE,
"http://www.itu.edu.tr/", MIRROR_STANDARD, TRUE,
"tr", MIRROR_OK),
"http://tr2.php.net/" => array(
"TUR", "DGN Teknoloji", FALSE,
"http://www.dgn.net.tr/", MIRROR_STANDARD, TRUE,
"tr", MIRROR_OK),
"http://ua1.php.net/" => array(
"UKR", "ELRO Corporation", FALSE,
"http://elro.com", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://ua2.php.net/" => array(
"UKR", "Max Khaikin", FALSE,
"http://www.masterlogic.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://uk1.php.net/" => array(
"GBR", "Camel Network", TRUE,
"http://camelnetwork.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://uk3.php.net/" => array(
"GBR", "CatN PHP Hosting", TRUE,
"http://www.catn.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://tz1.php.net/" => array(
"TZA", "Aptus Solutions", TRUE,
"http://aptus.co.tz", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://us1.php.net/" => array(
"USA", "NEXCESS.NET", FALSE,
"http://www.nexcess.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://us2.php.net/" => array(
"USA", "Hurricane Electric", FALSE,
"http://he.net/", MIRROR_STANDARD, TRUE,
"en", MIRROR_OK),
"http://us3.php.net/" => array(
"USA", "C7 Data Centers", TRUE,
"http://www.c7dc.com/", MIRROR_STANDARD, TRUE,
"en", MIRROR_DOESNOTWORK),
"http://www.php.net/" => array(
"USA", "Yahoo! Inc.", FALSE,
"http://developer.yahoo.com/", MIRROR_SPECIAL, TRUE,
"en", MIRROR_OK),
"http://docs.php.net/" => array(
"XXX", "EUKhost", FALSE,
"http://eukhost.com/", MIRROR_SPECIAL, TRUE,
"en", MIRROR_DOESNOTWORK),
);

View File

@@ -107,6 +107,9 @@ function myphpnet_load()
if (!empty($_COOKIE['MYPHPNET'])) {
$MYPHPNET = explode(",", $_COOKIE['MYPHPNET']);
}
// Ignore site part, and always use https://www.php.net
$MYPHPNET[2] = 'https://www.php.net';
}
// Get or set preferred language code
@@ -145,22 +148,6 @@ function myphpnet_urlsearch($type = FALSE)
} else { return MYPHPNET_URL_NONE; }
}
// Set mirror site redirection
function myphpnet_mirror($murl = FALSE)
{
global $MYPHPNET;
// Set mirror URL if specified and if correct
if ($murl && ($murl == "AUTO" || mirror_status($murl) == MIRROR_OK)) {
$MYPHPNET[2] = $murl;
}
// Return code or NONE
elseif (isset($MYPHPNET[2])) {
return $MYPHPNET[2];
} else { return "NONE"; }
}
function myphpnet_showug($enable = null) {
global $MYPHPNET;

View File

@@ -1,7 +1,24 @@
<?php // -*- C++ -*-
// Define $MIRRORS array, and some constants
include $_SERVER['DOCUMENT_ROOT'] . '/include/mirrors.inc';
// Define some constants, and $MIRRORS array
// Mirror type constants
define('MIRROR_DOWNLOAD', 0);
define('MIRROR_STANDARD', 1);
define('MIRROR_SPECIAL', 2);
define('MIRROR_VIRTUAL', 3);
// Mirror status constants
define('MIRROR_OK', 0);
define('MIRROR_NOTACTIVE', 1);
define('MIRROR_OUTDATED', 2);
define('MIRROR_DOESNOTWORK', 3);
$MIRRORS = array(
"https://www.php.net/" => array(
"DEU", "MyraCloud", FALSE,
"https://myracloud.com/en/", MIRROR_SPECIAL, TRUE,
"en", MIRROR_OK),
);
// Define $COUNTRIES array
include $_SERVER['DOCUMENT_ROOT'] . '/include/countries.inc';
@@ -12,7 +29,6 @@ include $_SERVER['DOCUMENT_ROOT'] . '/include/countries-alpha2.inc';
// Define $COUNTRY_ALPHA_2_TO_3 array
include $_SERVER['DOCUMENT_ROOT'] . '/include/countries_alpha_mapping.inc';
// Define $LANGUAGES array
include $_SERVER['DOCUMENT_ROOT'] . '/include/languages.inc';
@@ -22,16 +38,7 @@ function is_primary_site($site = FALSE)
{
global $MYSITE;
if (!$site) { $site = $MYSITE; }
return ($site == "https://www.php.net/" || $site == "https://php.net/" );
}
// Returns true if the current (or specified)
// site is the backup site of the primary site
function is_backup_primary($site = FALSE)
{
global $MYSITE;
if (!$site) { $site = $MYSITE; }
return $site == "http://download.php.net/";
return ($site == "https://www.php.net/" );
}
// Returns true if the current (or specified)
@@ -68,15 +75,6 @@ function have_stats($site = FALSE)
return (isset($MIRRORS[$site]) ? $MIRRORS[$site][2] : FALSE);
}
// Returns the current (or specified)
// mirror site's country code
function mirror_country($site = FALSE)
{
global $MIRRORS, $MYSITE;
if (!$site) { $site = $MYSITE; }
return (isset($MIRRORS[$site]) ? $MIRRORS[$site][0] : FALSE);
}
// Returns the current (or specified)
// mirror site's provider's name
function mirror_provider($site = FALSE)
@@ -85,9 +83,9 @@ function mirror_provider($site = FALSE)
if (!$site) { $site = $MYSITE; }
if (isset($MIRRORS[$site])) {
return $MIRRORS[$site][1];
return $MIRRORS[$site][1];
} elseif (isset($MIRRORS[$_SERVER['SERVER_ADDR']])) {
return $MIRRORS[$_SERVER['SERVER_ADDR']][1];
return $MIRRORS[$_SERVER['SERVER_ADDR']][1];
}
return false;
@@ -125,39 +123,6 @@ function mirror_type($site = FALSE)
return false;
}
// Returns the current (or specified)
// mirror site's status (use the constants!)
function mirror_status($site = FALSE)
{
global $MIRRORS, $MYSITE;
if (!$site) { $site = $MYSITE; }
if (isset($MIRRORS[$site])) {
return $MIRRORS[$site][7];
} elseif (isset($MIRRORS[$_SERVER['SERVER_ADDR']])) {
return $MIRRORS[$_SERVER['SERVER_ADDR']][7];
}
return false;
}
// Count all mirrors or mirrors in a given country
function count_mirrors($country = FALSE)
{
global $MIRRORS;
// This is a non-identified country
if ($country == "NA") { return 0; }
// Count only the ones in the same country
$count = 0;
foreach ($MIRRORS as $murl => $mirror) {
if (mirror_status($murl) != MIRROR_OK) { continue; }
if ($country === FALSE || mirror_country($murl) == $country) { $count++; }
}
return $count;
}
// Redirect to an URI on this mirror site or outside this site
function mirror_redirect($absoluteURI)
{
@@ -194,74 +159,6 @@ function mirror_setcookie($name, $content, $exptime)
}
}
function organise_mirrors($mirrors) {
// Lets group the mirrors by country code, for easy output on the page.
$retval = array();
foreach($mirrors as $key => $mirror) {
// If the mirror is not all right or it is virtual (not an official mirror), skip it
if (mirror_status($key) != MIRROR_OK || mirror_type($key) == MIRROR_VIRTUAL) { continue; }
if(!isset($grouped_mirrors[$mirror[0]])) {
$grouped_mirrors[$mirror[0]] = array();
}
$retval[$mirror[0]][] = array(
'url' => $key,
'country_code' => $mirror[0],
'provider_title' => $mirror[1],
'provider_url' => $mirror[3]
);
}
return $retval;
}
function print_full_mirror_list($download_file = null, $direct_download = false) {
global $COUNTRIES, $COUNTRY, $MIRRORS;
$groupped = organise_mirrors($MIRRORS);
$close = count_mirrors($COUNTRY);
if ($close) {
$mnum = (($close > 1) ? "mirrors" : "mirror");
echo "<p>We have automatically detected the following $mnum to be close to you</p>";
if (isset($groupped[$COUNTRY])) {
print_mirror_box($COUNTRIES[$COUNTRY], $COUNTRY, $groupped[$COUNTRY], $download_file, $direct_download, true);
echo "<br>";
}
}
foreach($groupped as $mirrorcode => $country) {
print_mirror_box($COUNTRIES[$mirrorcode], $mirrorcode, $country, $download_file, $direct_download, false);
}
}
function print_mirror_box($countryname, $countrycode, $mirrors, $file = null, $direct_download = false, $homecountry = false) {
?>
<div class="mirror <?php echo $homecountry ? "homecountry" : ""?>">
<div class="title"><?php echo $countryname; ?>
<img alt="<?php echo $countrycode; ?>"
height="25"
width="45"
src="<?php echo $_SERVER['MYSITE'] . '/images/flags/beta/' . strtolower($countrycode) . '.png'; ?>">
</div>
<?php foreach($mirrors as $mirror): ?>
<?php
$url = $mirror["url"];
$urltitle = substr($url, strpos($url, '//') + 2, -1);
if ($file) {
$what = $direct_download ? "this" : "a";
$url = $mirror["url"] . "get/$file/from/$what/mirror";
}
?>
<div class="entry">
<div class="url"><a href="<?php echo htmlentities($url, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); ?>" title="<?php echo clean($mirror['url']); ?>"><?php echo clean($urltitle); ?></a></div>
<div class="provider"><a href="<?php echo $mirror['provider_url']; ?>" title="<?php echo clean($mirror['provider_title']); ?>"><?php echo clean($mirror['provider_title']); ?></a></div>
</div>
<?php endforeach; ?>
</div>
<?php
}
// Use this function to write out proper headers on
// pages where the content should not be publicly cached
function header_nocache()
@@ -510,41 +407,9 @@ if($_SERVER["SERVER_PORT"] != '80' && $_SERVER["SERVER_PORT"] != 443) {
$msite = 'http://' . $_SERVER["SERVER_NAME"] . ':' . (int)$_SERVER["SERVER_PORT"] . '/';
} else {
$MYSITE = $proto . '://' . $_SERVER["SERVER_NAME"] . '/';
$msite = 'http://' . $_SERVER["SERVER_NAME"] . '/';
$msite = 'https://' . $_SERVER["SERVER_NAME"] . '/';
}
// If this site does not exist - it is most likely because
// CC.php.net isn't in this array anymore.
if (!isset($MIRRORS[$MYSITE])) {
if (isset($MIRRORS[$msite])) {
$MIRRORS[$MYSITE] = $MIRRORS[$msite];
unset($MIRRORS[$msite]);
}
}
if (!isset($MIRRORS[$MYSITE])) {
// Check if the IP address exists (a fix for the round-robin introduction)
if (isset($MIRRORS[$_SERVER['SERVER_ADDR']])) {
// Since it does, we know the servername is fine
$MYSITE = $proto . '://' . $_SERVER["SERVER_NAME"] . '/';
} else {
// Try the hostname [without www]. In case the main name above is
// not found, we try to find the mirror with the name provided by
// the browser (in the Host HTTP header).
$msite = str_replace("www.", "", $msite);
// If the name without www. exists, use it
if (isset($MIRRORS[$msite])) {
$MYSITE = str_replace("www.", "", $MYSITE);
if (!isset($MIRRORS[$MYSITE])) {
$MIRRORS[$MYSITE] = $MIRRORS[$msite];
unset($MIRRORS[$msite]);
}
}
}
}
// If the mirror is not registered with this name, provide defaults
// (no country code, no search, no stats, English default language ...)

View File

@@ -38,7 +38,7 @@ if (is_official_mirror()) {
);
// Add size information depending on mirror type
if (is_primary_site() || is_backup_primary()) {
if (is_primary_site()) {
$MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 125, 125);
} else {
$MIRROR_IMAGE = resize_image($MIRROR_IMAGE, 120, 60);

View File

@@ -5,9 +5,7 @@ include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
$SIDEBAR_DATA = '
<h3>Other mirror information</h3>
<p>
Properly working mirror sites are listed on <a href="/mirrors.php">our
mirrors page</a> and set by <a href="/my.php">my.php</a>. See also the
instructions for <a href="/mirroring.php">setting up a mirror</a>.
See also the instructions for <a href="/mirroring.php">setting up a mirror</a>.
</p>
';
@@ -105,18 +103,6 @@ site_header("The PHP mirrors problem and troubleshooting guide", array("current"
<code>AddType application/octet-stream .msi</code>
</p>
<a name="unlisted"></a>
<h3>An unlisted mirror</h3>
<p>
If you have an official mirror server but it's not listed on
<a href="/mirrors.php">mirrors.php</a> or available from
<a href="/my.php">my.php</a> then your mirror most likely failed the mirror
tests and suffers from one of the problems listed here. Mirrors that fail
the tests are automatically removed from the listing for our user's
convenience. We send out weekly notifications to all disabled mirror
maintainers, and to the mirrors@lists.php.net mailing list.
</p>
<a name="slow"></a>
<h3>Slow response time</h3>
<p>

View File

@@ -31,85 +31,12 @@ site_header(
<h1>Mirroring The PHP Website</h1>
<p>
If you would like to participate in the official PHP mirrors program,
please read and follow these instructions carefully. You should have
the consent of your hosting company (if you aren't a hosting company
yourself), and be prepared for some potentially significant bandwidth
usage. As of 25 September, 2013, the network of mirrors is averaging
251GB per day (about 7.52TB per month). At the time of the updating
of this page, this load was spread across 90 active mirrors, indicating
an overall average of 2.9GB per mirror. This can go up to 12GB per
day or more for busy mirrors, such as those in the US, UK, and India.
And immediately following new releases of PHP, the traffic spikes even
higher (as should be expected) due to a surge in the number of downloads.
Please be sure your server or hosting account is able to handle a minimum
of roughly 42 gigabytes of transfer each month without incurring any
additional costs or penalties, as the mirrors with the fewest requests
per month are still averaging this amount of bandwidth usage per month.
In the event that such action is taken against your account, remember:
it is your responsibility.
The PHP project does no have an official mirror program anymore, but you can
set-up a mirror for your own network or company.
</p>
<p>
Official mirror program participants are required to use PHP 5.3.21 or
greater, but please note that we encourage maintainers to always use the
latest stable versions of actively-developed branches. Please note that
we do, somewhat regularly (about once per year) require existing
maintainers to upgrade their PHP versions to a new minimum, so always
being proactive in upgrades will ensure that your mirror remains in
compliance with the official mirrors program. Set it up as an Apache
module with the settings <a href="#settings">outlined below</a>, or in
any other Apache connected way (CGI, FastCGI, etc), considering the
requested PHP settings outlined below in the Apache vhost instructions.
The size of the full website is approximately 4.7 gigabytes.
</p>
<p>
<b>NOTE:</b> Some of our maintainers prefer to use web servers other
than Apache, such as <a href="http://wiki.nginx.org/Main" target="_blank">Nginx</a>.
While this is permitted (as long as everything ultimately works as
directed), we do not officially support these setups at this time.
If you would like to learn how to set up an alternative environment,
feel free to post a question to current mirror maintainers on the
mailing list at <a href="mailto:php-mirrors@lists.php.net">php-mirrors@lists.php.net</a>.
</p>
<p>
Applications to join the official mirror program are reviewed on a
case-by-case basis, but we will only approve those from ISPs and web
hosting providers; universities and state-recognized academic institutions;
PHP-centric web development firms; and PHP user groups and individual
enthusiasts. Under no circumstances will we even review applications from
marketing firms, website portals or directories, or anything of
questionable moral or legal standing. We also reserve the right, at our
discretion, and without warning, to refuse any application for any reason,
or to suspend or expell any active mirrors if it is discovered that any
information on the application was false or otherwise incorrect, or if
the mirrors fails to remain in compliance with the official mirrors program.
</p>
<a name="rule"></a>
<p class="warn">
Please note that we are currently only accepting new applications for
countries in which we don't already have two official mirror presences.
For a list of active official mirrors, see <a href="/mirrors.php">mirrors.php</a>.
Prior to attempting to set up an official mirror site, you are advised to contact <a
href="mailto:php-mirrors@lists.php.net">php-mirrors@lists.php.net</a> (a public
mailing list, archived in numerous places on the Internet) to inquire as to
whether or not your application may be accepted. We have found that this limit
serves our users well, so please do not ask to provide a third mirror for a country
that already has two. Please also be aware that the mirror is required to be
physically located in the country you would like to serve. If there are already
two mirrors in a country for which you would like to provide an official mirror,
you may add your information to the official waiting list, which can be found
<a href="http://php.parasane.net/mirrors/waitinglist.php">here</a>. If and when
a vacancy becomes available, we will go through the applications on the waiting
list before entertaining new public applications.
</p>
<p>
If you are not an official mirror (e.g. you mirror the site for your company's
internal use), you should not synchronize from our network more frequently
You should not synchronize from our network more frequently
than once every six hours, or you may find your IP blocked. Also, please make
an effort to only mirror those parts of the site that you actually need.
(For example, <a href="#exclude">exclude the manual in all languages that you
@@ -120,20 +47,11 @@ site_header(
<p>
First, you need to have a <a href="http://rsync.samba.org/">rsync</a>
installed. To better serve our official mirror providers and maintainers,
we switched to a geographically-decentralized distribution architecture. By
switching from a single United States-based master server to three Regional
Rsync Nodes (RRNs), we're able to reduce the amount of latency and time to
transfer data between an RRN and a mirror, serve more requests per hour
(allowing for a closer to real-time network update globally), and provide
redundancy in the event of an outage of a sync server.
</p>
<p>
To synchronize your server with the appropriate RRN, first view the <a
installed.
To synchronize your server with the appropriate rsync location, first view the <a
href="/images/oidk.net-rsync-distribution-plan-may2012.png">coverage map</a>
and identify which RRN your mirror should be using. Next, modify the
following code for use with your mirror. Replace <code>YOUR_RRN_HOSTNAME</code>
and identify which location your mirror should be using. Next, modify the
following code for use with your mirror. Replace <code>YOUR_RRN_HOSTNAME</code>
with your RRN's hostname as indicated by the coverage map and be sure to
change <code>/your/local/path</code> with the path to where your php.net
mirror will reside on the filesystem.
@@ -147,8 +65,7 @@ site_header(
<a name="exclude"></a>
<p>
Setting up an unofficial mirror, and want to only mirror one
language of the manual? Add:
If you only want to mirror mirror one language of the manual? Add:
</p>
<pre class="info">
@@ -164,7 +81,7 @@ site_header(
</p>
<p>
Official PHP mirror sites should provide the exact content coming from our servers,
PHP mirror sites should provide the exact content coming from our servers,
and must not be altered in any way unless explicitly stated in the mirroring
guidelines. Failing to do will result in immediate termination and permanent
expulsion of your participation in the program.
@@ -175,9 +92,8 @@ site_header(
<p>
<a href="http://www.sqlite.org">SQLite</a> is an embedded
SQL database implementation that has very high performance for applications
with low write concurrency. PHP mirrors currently employ SQLite for URL
shortcut lookups, and it is a requirement of all official mirrors to have
it installed and available to PHP.
with low write concurrency. PHP mirrors can currently employ SQLite for URL
shortcut lookups.
</p>
<p>
@@ -212,8 +128,7 @@ site_header(
Options -Indexes -MultiViews
&lt;/Directory&gt;
ServerName ccx.php.net
ServerAlias cc.php.net www.php.net the.cname.you.set.up.example.com
ServerName mymirror.example.com
ServerAdmin yourname@example.com
UseCanonicalName On
@@ -264,57 +179,13 @@ site_header(
&lt;/VirtualHost&gt;
</pre>
<p>
You should only start to set up an Apache VirtualHost for an official
mirror if you have <a href="#rule">contacted us first</a> and received
the permanent names for your mirror. The names for all official PHP mirrors
are in the convention: <code>ccx.php.net</code>, where <code>cc</code>
stands for the 2-letter ISO country code of your mirror's location and
<code>x</code> is an incremental identifier for the mirrors of that country.
Do not assume that you know the code you will receive until your application
has been reviewed and approved, and do not submit an application saying, for
example, "We are applying to become DE1.PHP.NET." It's possible that the
mirror already exists, but is experiencing issues that have it temporarily
removed from active rotation, and delisted from the roster of mirrors. We do
not want anyone to waste their time only to have their application altered
or rejected. The mirrors should also listen for the <code>cc.php.net</code>
hostname, as we moved to providing a simple load-balancing solution:
<a href="http://en.wikipedia.org/wiki/Round-robin_DNS">round-robin DNS</a>.
All mirrors are required to be configured for both CC and CCX, so any active
mirror can receive traffic for their respective <code>cc.php.net</code>
hostname, thus providing redundancy and improved uptime for visitors.
</p>
<p>
Before adding new official mirrors to our DNS, we require the maintainers
to set up the mirrors with an address we can use as a CNAME in the DNS.
This subdomain (<code>the.cname.you.set.up.example.com</code> in the above
example) will be checked by mirror admins before the mirror is added.
Therefore it is important that the mirror is capable of serving requests
for this name and the <code>(www.)cc(x).php.net</code> address provided by the
mirror administrators.
</p>
<p class="warn">
The hostname you provide to us must be a configured hostname to be entered
into our DNS as a CNAME, not an IP address to be used as an A record. Your
local DNS information may then translate into both IPv4 and IPv6, should
you so desire and have the capabilities, but may not exclude IPv4 from the
record until further notice.
</p>
<p>
When setting up the vhost, provide an asterisk, a hostname, or an IP
address in the VirtualHost container's header (depending on whether
you would like to make the vhost work for all IPs handled by Apache,
or just a specific hostname/IP address). Consult
<a href="http://httpd.apache.org/docs/vhosts/index.html">the Apache
documentation</a> for the differences of the two methods. It is very
important to use your <code>ccx.php.net</code> address as the ServerName, so
URL redirections will keep the requests in the php.net domain, ensuring
that the My PHP.net service will work. Failure to do so will also cause
your mirror to show up as an unofficial mirror, and to be removed from the
roster page.
documentation</a> for the differences of the two methods.
</p>
<p>
@@ -340,13 +211,13 @@ site_header(
<p>
You must also set up a cron job that periodically does an rsync to
refresh your web directory. We prefer that all mirrors update from
the appropriate RRN from the coverage map every five minutes, to
the appropriate RRN from the coverage map not more than once an hour, to
speed up the distribution of updates to the site and available packages.
Something like:
</p>
<pre class="info">
*/5 * * * * rsync -avzC --timeout=600 --delete --delete-after --include='distributions/*.exe' YOUR_RRN_HOSTNAME::phpweb /your/local/path
5 * * * * rsync -avzC --timeout=600 --delete --delete-after --include='distributions/*.exe' YOUR_RRN_HOSTNAME::phpweb /your/local/path
</pre>
<p>
@@ -387,11 +258,7 @@ site_header(
on your hosting company's site if possible. Grab one of the logos
from the <a href="/download-logos.php">logos download</a> page, and
link it to your mirror. This shows the community that you are a
proud supporter of PHP and open source technology, and you will be
worshipped every hour, on the hour, in song and dance, by millions of
<a href="http://en.wikipedia.org/wiki/Proboscis_monkey" target="_blank">proboscis monkeys</a>
the world over. Well, okay, perhaps not.... but folks will certainly
appreciate your generosity and support!
proud supporter of PHP and open source technology.
</p>
<h2>Mirror Setup Troubleshooting</h2>
@@ -403,68 +270,17 @@ site_header(
perform many of the tests executed by the automated mirror management tools.
</p>
<h2>Data Registered About Official Mirrors</h2>
<p>
Once you have done the above and your site appears to work, send a message
to <a href="mailto:php-mirrors@lists.php.net">php-mirrors@lists.php.net</a>
with the following information, and appropriate steps will be taken to
integrate your mirror site:
</p>
<ul>
<li>
Your country.
</li>
<li>
The ccx.php.net address you used to set up the mirror site, which
you obtained previously in a conversation with the mirror admins.
</li>
<li>
Your name and email address to be registered as the admin of the mirror.
</li>
<li>
A hostname that we can use as a CNAME for the country-code-based
name of the mirror (<code>the.cname.you.set.up.example.com</code> in the
above setup example). Using a name means you can move the mirror to
another IP address without coordinating with us at all (though, obviously,
it must still be in the country you intend to serve).
</li>
<li>
Whether or not you've installed local stats support on your mirror.
</li>
<li>
The name of the sponsor approved previously by mirror program staff.
</li>
<li>
The URL of the sponsor. This link is provided with the sponsor's name
at the bottom of pages, with the sponsor image on the front page and
in the mirror listing.
</li>
</ul>
<p>
There is a mailing list named <code>"php-mirrors"</code> at
<code>lists.php.net</code>, to which you are required to subscribe.
<code>lists.php.net</code>, to which you can subscribe.
This mailing list is very low-traffic and only used for communication
between mirror maintainers and php.net webmasters, and to provide
automatic information on mirror outages and other issues.
between mirror maintainers and php.net webmasters.
</p>
<p>
To subscribe send an empty message
to: <a href="mailto:php-mirrors-subscribe@lists.php.net">php-mirrors-subscribe@lists.php.net</a>
</p>
<p>
We also operate an EFNet channel, and encourage you to join us there.
If you are interested, please join us at <code>#php.mirrors</code>.
Many maintainers and staff members idle in the room around the clock,
and are available to address questions, concerns, or issues in
real-time (keeping in mind that the mailing list is the official
support channel, and this is just a convenient additional method of
communication between teams).
</p>
<p>
<em>
Thank you for your interest in providing a mirror! If you ever have any

View File

@@ -1,44 +1,5 @@
<?php
$_SERVER['BASE_PAGE'] = 'mirrors.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/layout.inc';
$header_config = array(
'current' => 'community',
'css' => array('mirror.css')
);
site_header("Mirror Sites", $header_config);
?>
<div id="mirrors-container">
<h1 class="title">Mirror Sites</h1>
<div class="mirrors-header">
<p>
Listed below are the official, active, and fully functional PHP.net mirrors.
Some mirrors might be missing from this list because mirrors are
automatically deactivated when problems arise. Mirrors are continuously
checked and reactivated when appropriate.
</p>
<p>
We suggest you <a href="my.php">choose</a> a PHP.net mirror that is
geographically close to you. All mirrors provide identical features and
services, with the only difference being the increased speed that close
mirrors provide. Your current mirror is highlighted in the list below.
</p>
<p>
If you are interested in hosting a mirror of this site,
<a href="/mirroring.php">read our mirroring page</a>.
</p>
</div>
<div class="mirrors-list">
<?php print_full_mirror_list() ?>
</div>
</div>
<?php
site_footer();
header("HTTP/1.1 301 Moved Permanently");
header("Location: /");

59
my.php
View File

@@ -58,10 +58,7 @@ if (isset($_POST["showug"])) {
myphpnet_showug($_POST["showug"] == "enable");
}
// Set preferred mirror site, prepare mirror array
if (isset($_POST['mirror'])) {
myphpnet_mirror($_POST['mirror']);
}
// Prepare mirror array
$mirror_sites = $MIRRORS;
$mirror_sites["NONE"] = array(7 => MIRROR_OK);
@@ -152,12 +149,10 @@ foreach ($langinfo as $lin => $lid) {
<h2>Your country</h2>
<p>
The PHP.net site and mirror sites try to detect your country
The PHP.net site tries to detect your country
using the <a href="http://www.directi.com/?site=ip-to-country">Directi
Ip-to-Country Database</a>. This information is used to mark
the events in your country specially and to offer close mirror
sites if possible on the download page and on the mirror listing
page.
the events in your country specially.
</p>
<div class="indent">
@@ -195,54 +190,6 @@ if ($type === MYPHPNET_URL_MANUAL) {
> PHP Documentation search
</div>
<h2>Mirror site redirection</h2>
<p>
The php.net site redirects users to mirror sites in several cases
automatically. It tries to find a close mirror first (a mirror in the
user's country), and if no such mirror is found, it selects one mirror
randomly. Here you can set one preferred mirror site for yourself in
case you are not satisfied with the automatic selection.
</p>
<p>
Please note that in case the site finds your preferred mirror site disabled
for some reason, it will fall back to the automatic selection procedure, but
will not alter your preferences, so next time when your selected server works,
the redirections will lead you there.
</p>
<div class="indent">
<select name="mirror">
<?php
$mirror = myphpnet_mirror();
foreach ($mirror_sites as $murl => $mdata) {
// Skip inactive mirrors
if (mirror_status($murl) != MIRROR_OK ||
$murl == "http://www.php.net/" || $murl == 'http://php.net/') { continue; }
// Compute user friendly mirror name
if ($murl == "NONE") {
$mname = "Automatic selection (default)";
} else {
$tmpurl = " (" .substr($murl, strpos($murl, '//') + 2, -1). ")";
if (isset($COUNTRIES[$mdata[0]])) {
$mname = $COUNTRIES[$mdata[0]] . $tmpurl;
} else {
$mname = "Unknown" . $tmpurl;
}
}
// Print out mirror option with selection if needed
printf (
" <option value=\"$murl\"%s>$mname</option>\n",
($mirror == $murl ? ' selected="selected"' : '')
);
}
?>
</select>
</div>
<br>
<h2>User Group tips</h2>

View File

@@ -49,7 +49,7 @@ XML;
$maxtime[] = $time = strtotime($source["date"]);
$released = date(DATE_ATOM, $time);
echo " <link rel=\"enclosure\" title=\"{$source["name"]}\" href=\"/get/{$source["filename"]}/from/this/mirror\">\n";
echo " <link rel=\"enclosure\" title=\"{$source["name"]}\" href=\"/distributions/{$source["filename"]}\">\n";
foreach (array('md5', 'sha256') as $hashAlgo) {
if (isset($source[$hashAlgo])) {
echo " <php:{$hashAlgo}>{$source[$hashAlgo]}</php:{$hashAlgo}>\n";

View File

@@ -21,7 +21,7 @@ $SIDEBAR_DATA = <<< EOT
<h3>Other links</h3>
<ul>
<li><a href="http://php.net/manual/security">PHP manual on security</a></li>
<li><a href="https://www.php.net/manual/security">PHP manual on security</a></li>
<li><a href="http://www.suhosin.org">Suhosin</a></li>
<li><a href="http://phpsec.org/projects/guide/">PHP Security Consortium</a></li>
</ul>

View File

@@ -79,21 +79,11 @@ site_header("Sitemap", array("current" => "help"));
<!-- <li><a href="/svnsync.php">Maintaining a Local SVN Repository</a></li> -->
</ul>
<h2>Mirror sites</h2>
<h2>Site information</h2>
<ul>
<li>Mirror site information
<ul>
<li><a href="/mirrors.php">List of Mirror Sites</a></li>
<li><a href="/mirror.php">Information About this Mirror Site</a></li>
</ul>
</li>
<li>Mirroring
<ul>
<li><a href="/mirroring.php">Mirroring PHP.net</a></li>
<li><a href="/mirroring-stats.php">Mirroring - stats service</a></li>
</ul>
</li>
<li><a href="/mirror.php">Information About this Site</a></li>
<li><a href="/mirroring.php">Mirroring PHP.net locally</a></li>
</ul>
<h2>Other pages</h2>

View File

@@ -82,9 +82,6 @@
<url>
<loc>http://php.net/mirroring.php</loc>
</url>
<url>
<loc>http://php.net/mirrors.php</loc>
</url>
<url>
<loc>http://php.net/my.php</loc>
</url>