From b2b48ca1e053eae9ed0ace036b69ff3ab6926869 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 29 Mar 2019 12:20:01 +0000 Subject: [PATCH] Remove references, redirects, and selection of mirrors --- cached.php | 4 +- download-docs.php | 4 +- error.php | 15 +- include/footer.inc | 1 - include/get-download.inc | 28 +-- include/header.inc | 2 +- include/layout.inc | 17 +- include/loadavg.inc | 54 +---- include/mirrors.inc | 414 --------------------------------------- include/prepend.inc | 19 +- include/site.inc | 181 +++-------------- mirror.php | 2 +- mirroring-troubles.php | 16 +- mirroring.php | 220 ++------------------- mirrors.php | 43 +--- my.php | 59 +----- releases/feed.php | 2 +- security/index.php | 2 +- sitemap.php | 16 +- sitemap.xml | 3 - 20 files changed, 69 insertions(+), 1033 deletions(-) delete mode 100644 include/mirrors.inc diff --git a/cached.php b/cached.php index 6937a53b6..e155a44cb 100644 --- a/cached.php +++ b/cached.php @@ -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; } diff --git a/download-docs.php b/download-docs.php index 7479564ba..1dfec33ff 100644 --- a/download-docs.php +++ b/download-docs.php @@ -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 "

This mirror has no documentation files for download.

"; + echo "

This site has no documentation files for download.

"; } else { echo '' . "\n" . diff --git a/error.php b/error.php index 3f1cc7c99..1da1f277d 100644 --- a/error.php +++ b/error.php @@ -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])) { diff --git a/include/footer.inc b/include/footer.inc index b09b2e638..1d6227f54 100644 --- a/include/footer.inc +++ b/include/footer.inc @@ -67,7 +67,6 @@
  • My PHP.net
  • Contact
  • Other PHP.net sites
  • -
  • Mirror sites
  • Privacy policy
  • diff --git a/include/get-download.inc b/include/get-download.inc index 3268cac1c..f19e3f79e 100644 --- a/include/get-download.inc +++ b/include/get-download.inc @@ -32,8 +32,8 @@ $size = 0; // No downloadable file found if ($file === FALSE) { $info = "

    - The file you requested ( " . htmlspecialchars($df, ENT_QUOTES, "UTF-8") . " ) is not found on - this server ({$MYSITE}). Please try another mirror listed below

    "; + The file you requested (" . htmlspecialchars($df, ENT_QUOTES, "UTF-8") . ") is not found on + this server ({$MYSITE}).

    "; echo <<Download not found @@ -44,32 +44,8 @@ EOT; $local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $file; // Try to get filesize to display $size = @filesize($local_file); - - -?> - -

    Choose mirror site for download

    - -

    - You have chosen to download the following file: - - - -(' . number_format($size, 0, '.', ',') . ' bytes)'; } ?> - -

    - - - -
    - -
    diff --git a/include/header.inc b/include/header.inc index 552fb2168..48a93ebd3 100644 --- a/include/header.inc +++ b/include/header.inc @@ -62,7 +62,7 @@ if (!isset($config["languages"])) { - + diff --git a/include/layout.inc b/include/layout.inc index a520d13d8..4ef1de670 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -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"; diff --git a/include/loadavg.inc b/include/loadavg.inc index 2b20e3204..85d63a530 100644 --- a/include/loadavg.inc +++ b/include/loadavg.inc @@ -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(); diff --git a/include/mirrors.inc b/include/mirrors.inc deleted file mode 100644 index b25d88012..000000000 --- a/include/mirrors.inc +++ /dev/null @@ -1,414 +0,0 @@ - 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), -); diff --git a/include/prepend.inc b/include/prepend.inc index c7e995cd3..674366ef1 100644 --- a/include/prepend.inc +++ b/include/prepend.inc @@ -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; diff --git a/include/site.inc b/include/site.inc index d9e1eb866..e096c16a5 100644 --- a/include/site.inc +++ b/include/site.inc @@ -1,7 +1,24 @@ 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 "

    We have automatically detected the following $mnum to be close to you

    "; - - if (isset($groupped[$COUNTRY])) { - print_mirror_box($COUNTRIES[$COUNTRY], $COUNTRY, $groupped[$COUNTRY], $download_file, $direct_download, true); - echo "
    "; - } - } - 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) { -?> -
    "> -
    - <?php echo $countrycode; ?> -
    - - -
    -
    -
    -
    - -
    -Other mirror information

    - Properly working mirror sites are listed on our - mirrors page and set by my.php. See also the - instructions for setting up a mirror. + See also the instructions for setting up a mirror.

    '; @@ -105,18 +103,6 @@ site_header("The PHP mirrors problem and troubleshooting guide", array("current" AddType application/octet-stream .msi

    - -

    An unlisted mirror

    -

    - If you have an official mirror server but it's not listed on - mirrors.php or available from - my.php 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. -

    -

    Slow response time

    diff --git a/mirroring.php b/mirroring.php index 7f2b84ca6..974fd53cf 100644 --- a/mirroring.php +++ b/mirroring.php @@ -31,85 +31,12 @@ site_header(

    Mirroring The PHP Website

    - 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.

    - 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 outlined below, 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. -

    - -

    - NOTE: Some of our maintainers prefer to use web servers other - than Apache, such as Nginx. - 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 php-mirrors@lists.php.net. -

    - -

    - 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. -

    - - -

    - 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 mirrors.php. - Prior to attempting to set up an official mirror site, you are advised to contact php-mirrors@lists.php.net (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 - here. If and when - a vacancy becomes available, we will go through the applications on the waiting - list before entertaining new public applications. -

    - -

    - 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, exclude the manual in all languages that you @@ -120,20 +47,11 @@ site_header(

    First, you need to have a rsync - 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. -

    - -

    - To synchronize your server with the appropriate RRN, first view the coverage map - and identify which RRN your mirror should be using. Next, modify the - following code for use with your mirror. Replace YOUR_RRN_HOSTNAME + and identify which location your mirror should be using. Next, modify the + following code for use with your mirror. Replace YOUR_RRN_HOSTNAME with your RRN's hostname as indicated by the coverage map and be sure to change /your/local/path with the path to where your php.net mirror will reside on the filesystem. @@ -147,8 +65,7 @@ site_header(

    - 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:

    @@ -164,7 +81,7 @@ site_header(
     

    - 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(

    SQLite 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.

    @@ -212,8 +128,7 @@ site_header( Options -Indexes -MultiViews </Directory> - 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( </VirtualHost>

    -

    - You should only start to set up an Apache VirtualHost for an official - mirror if you have contacted us first and received - the permanent names for your mirror. The names for all official PHP mirrors - are in the convention: ccx.php.net, where cc - stands for the 2-letter ISO country code of your mirror's location and - x 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 cc.php.net - hostname, as we moved to providing a simple load-balancing solution: - round-robin DNS. - All mirrors are required to be configured for both CC and CCX, so any active - mirror can receive traffic for their respective cc.php.net - hostname, thus providing redundancy and improved uptime for visitors. -

    - -

    - 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 (the.cname.you.set.up.example.com 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 (www.)cc(x).php.net address provided by the - mirror administrators. -

    - -

    - 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. -

    -

    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 the Apache - documentation for the differences of the two methods. It is very - important to use your ccx.php.net 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 for the differences of the two methods.

    @@ -340,13 +211,13 @@ site_header(

    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:

    -   */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
     

    @@ -387,11 +258,7 @@ site_header( on your hosting company's site if possible. Grab one of the logos from the logos download 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 - proboscis monkeys - the world over. Well, okay, perhaps not.... but folks will certainly - appreciate your generosity and support! + proud supporter of PHP and open source technology.

    Mirror Setup Troubleshooting

    @@ -403,68 +270,17 @@ site_header( perform many of the tests executed by the automated mirror management tools.

    -

    Data Registered About Official Mirrors

    - -

    - Once you have done the above and your site appears to work, send a message - to php-mirrors@lists.php.net - with the following information, and appropriate steps will be taken to - integrate your mirror site: -

    - - -

    There is a mailing list named "php-mirrors" at - lists.php.net, to which you are required to subscribe. + lists.php.net, 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.

    To subscribe send an empty message to: php-mirrors-subscribe@lists.php.net

    -

    - We also operate an EFNet channel, and encourage you to join us there. - If you are interested, please join us at #php.mirrors. - 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). -

    -

    Thank you for your interest in providing a mirror! If you ever have any diff --git a/mirrors.php b/mirrors.php index 067ccbac7..ad3f17120 100644 --- a/mirrors.php +++ b/mirrors.php @@ -1,44 +1,5 @@ 'community', - 'css' => array('mirror.css') -); -site_header("Mirror Sites", $header_config); - - -?> -

    - -

    Mirror Sites

    - -
    -

    - 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. -

    -

    - We suggest you choose 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. -

    -

    - If you are interested in hosting a mirror of this site, - read our mirroring page. -

    -
    - -
    - -
    - -
    - - MIRROR_OK); @@ -152,12 +149,10 @@ foreach ($langinfo as $lin => $lid) {

    Your country

    - The PHP.net site and mirror sites try to detect your country + The PHP.net site tries to detect your country using the Directi Ip-to-Country Database. 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.

    @@ -195,54 +190,6 @@ if ($type === MYPHPNET_URL_MANUAL) { > PHP Documentation search
    -

    Mirror site redirection

    - -

    - 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. -

    - -

    - 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. -

    - -
    - -

    User Group tips

    diff --git a/releases/feed.php b/releases/feed.php index de41bfb18..aa218fcd8 100644 --- a/releases/feed.php +++ b/releases/feed.php @@ -49,7 +49,7 @@ XML; $maxtime[] = $time = strtotime($source["date"]); $released = date(DATE_ATOM, $time); - echo " \n"; + echo " \n"; foreach (array('md5', 'sha256') as $hashAlgo) { if (isset($source[$hashAlgo])) { echo " {$source[$hashAlgo]}\n"; diff --git a/security/index.php b/security/index.php index c6a332529..bb26eaf93 100644 --- a/security/index.php +++ b/security/index.php @@ -21,7 +21,7 @@ $SIDEBAR_DATA = <<< EOT

    Other links

    diff --git a/sitemap.php b/sitemap.php index 158b44367..c7e9edcee 100644 --- a/sitemap.php +++ b/sitemap.php @@ -79,21 +79,11 @@ site_header("Sitemap", array("current" => "help")); -

    Mirror sites

    +

    Site information

    Other pages

    diff --git a/sitemap.xml b/sitemap.xml index 6827fc42d..1a4604d2b 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -82,9 +82,6 @@ http://php.net/mirroring.php - - http://php.net/mirrors.php - http://php.net/my.php