Skip to content

Commit

Permalink
Add ability to to download latest PHP7 stuff using PHP7-LATEST
Browse files Browse the repository at this point in the history
  • Loading branch information
janaurka committed Mar 21, 2016
1 parent 71c3340 commit fc5c0e7
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions error.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,29 +135,32 @@
// ============================================================================
// Nice URLs for download files, so wget works completely well with download links
if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) {

$df = $dlinfo[1];
if(strpos($df, "5-LATEST") !== false) {
if(strpos($df, "7-LATEST") !== false) {
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/version.inc";
$df = str_replace("7-LATEST", $PHP_7_VERSION, $df);
} elseif(strpos($df, "5-LATEST") !== false) {
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/version.inc";
$df = str_replace("5-LATEST", $PHP_5_VERSION, $df);
} elseif(strpos($df, "4-LATEST") !== false) {
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/version.inc";
$df = str_replace("4-LATEST", $PHP_4_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]}/"; }

// Check if that mirror really exists if not, bail out
if(!isset($MIRRORS[$mr])) {
error_nomirror($mr);
Expand Down Expand Up @@ -191,7 +194,7 @@
file_exists($_SERVER['DOCUMENT_ROOT'] . "/$URI.php")) {
mirror_redirect("/$URI.php");
}

// Work with lowercased URI from now
$URI = strtolower($URI);

Expand Down Expand Up @@ -222,13 +225,13 @@
$manual_page_moves = array(
// entry point changed
'installation' => 'install',

// was split among platforms (don't know where to redirect)
'install.apache' => 'install',
'install.apache' => 'install',
'install.apache2' => 'install',
'install.netscape-enterprise'=> 'install',
'install.otherhttpd' => 'install',

// moved to platform sections
'install.caudium' => 'install.unix.caudium',
'install.commandline' => 'install.unix.commandline',
Expand Down Expand Up @@ -337,7 +340,7 @@
"splat" => "functions.arguments",

"dowhile" => "control-structures.do.while",

"tut" => "tutorial",
"tut.php" => "tutorial", // BC

Expand Down Expand Up @@ -398,26 +401,26 @@
"namespace" => "language.namespaces",
"use" => "language.namespaces.using",
"iterator" => "language.oop5.iterations",

"factory" => "language.oop5.patterns",
"singleton" => "language.oop5.patterns",

"trait" => "language.oop5.traits",
"traits" => "language.oop5.traits",

"news.php" => "archive/index", // BC
"readme.mirror" => "mirroring", // BC

"php5" => "language.oop5",
"zend_changes.txt" => "language.oop5", // BC
"zend2_example.phps" => "language.oop5", // BC
"zend_changes_php_5_0_0b2.txt" => "language.oop5", // BC
"zend-engine-2" => "language.oop5", // BC
"zend-engine-2.php" => "language.oop5", // BC

"news_php_5_0_0b2.txt" => "ChangeLog-5", // BC
"news_php_5_0_0b3.txt" => "ChangeLog-5", // BC

"manual/about-notes.php" => "manual/add-note", // BC
"software/index.php" => "software", // BC
"releases.php" => "releases/index", // BC
Expand All @@ -433,10 +436,10 @@
"regexp.reference.circudollar" => "regexp.reference.anchors",
"regexp.reference.squarebrackets" => "regexp.reference.character-classes",
"regexp.reference.verticalbar" => "regexp.reference.alternation",

# external shortcut aliases ;)
"dochowto" => "phpdochowto",

# CVS -> SVN
"anoncvs.php" => "git",
"cvs-php.php" => "git-php",
Expand Down

0 comments on commit fc5c0e7

Please sign in to comment.