Author: Derick Rethans (derickr)
Date: 2025-08-12T11:30:53+01:00

Commit: 
https://github.com/php/web-php/commit/b9cb22357cfef8596bbee08ec74c2bf7ab7a146d
Raw diff: 
https://github.com/php/web-php/commit/b9cb22357cfef8596bbee08ec74c2bf7ab7a146d.diff

Add 'source' checkbox, and add direct link to source tarballs

Changed paths:
  A  include/download-instructions/linux-source.php
  A  include/download-instructions/osx-source.php
  A  include/download-instructions/windows-source.php
  M  downloads-get-instructions.php
  M  downloads.php


Diff:

diff --git a/downloads-get-instructions.php b/downloads-get-instructions.php
index 650ffcaa70..09831f672a 100644
--- a/downloads-get-instructions.php
+++ b/downloads-get-instructions.php
@@ -37,6 +37,14 @@
        $multiversion = $options['multiversion'] === 'Y';
 }
 
+$source = false;
+
+if (array_key_exists('source', $options)) {
+       if ($options['source'] === 'Y') {
+               $source = $options['source'] === 'Y';
+       }
+}
+
 switch ($options['os']) {
        case 'linux':
                $defaultOrCommunity = ($options['version'] !== 'default' || 
$multiversion) ? 'community' : 'default';
@@ -51,16 +59,23 @@
                break;
 }
 
+if ($source) {
+    $file = "{$options['os']}-source";
+}
+
 $version = $options['version'];
 $versionNoDot = str_replace('.', '', $version);
 
 if (file_exists(__DIR__ . "/include/download-instructions/{$file}.php")) {
        include __DIR__ . "/include/download-instructions/{$file}.php";
+       if ($source) {
+               return false;
+       }
        return true;
 } else {
 ?>
 <p>
-There are no instructions yet. Try using the generic installation from source.
+    There are no instructions yet. Try using the <a 
href="https://www.php.net/manual/en/install.php";>generic installation from 
source</a>.
 </p>
 <?php
        return false;
diff --git a/downloads.php b/downloads.php
index e6b0eee362..8a30ac162e 100644
--- a/downloads.php
+++ b/downloads.php
@@ -16,6 +16,7 @@
   </div>
 </div>
 
+<p class="panel"><a href="downloads.php?source=Y">Source Tarballs</a></p>
 <p class="panel"><a href="download-docs.php">Documentation Download</a></p>
 <p class="panel"><a href="download-logos.php">PHP Logos</a></p>
 
@@ -156,13 +157,13 @@ function option(string $value, string $desc, $attributes 
= []): string
         <input type="checkbox" id="multiversion" name="multiversion" value="Y"
             <?= array_key_exists('multiversion', $options) && 
$options['multiversion'] === 'Y' ? 'checked' : '' ?>/>
     </label>
-<!--
+
     <label for="source" class="instructions-label">
         I want to compile everything from source:
         <input type="checkbox" id="source" name="source" value="Y"
             <?= array_key_exists('source', $options) && $options['source'] === 
'Y' ? 'checked' : '' ?>/>
     </label>
--->
+
     <noscript>
         <button type="submit" class="button">Update Instructions</button>
     </noscript>
diff --git a/include/download-instructions/linux-source.php 
b/include/download-instructions/linux-source.php
new file mode 100644
index 0000000000..47437b2c77
--- /dev/null
+++ b/include/download-instructions/linux-source.php
@@ -0,0 +1,4 @@
+<p>
+       The <a 
href="https://www.php.net/manual/en/install.unix.source.php";>instructions for 
compiling from source
+       on Linux</a> are described in the PHP manual.
+</p>
diff --git a/include/download-instructions/osx-source.php 
b/include/download-instructions/osx-source.php
new file mode 100644
index 0000000000..aa81b80171
--- /dev/null
+++ b/include/download-instructions/osx-source.php
@@ -0,0 +1,4 @@
+<p>
+       The <a 
href="https://www.php.net/manual/en/install.unix.source.php";>instructions for 
compiling from source
+       on macOS</a> are described in the PHP manual.
+</p>
diff --git a/include/download-instructions/windows-source.php 
b/include/download-instructions/windows-source.php
new file mode 100644
index 0000000000..beacab7f70
--- /dev/null
+++ b/include/download-instructions/windows-source.php
@@ -0,0 +1,4 @@
+<p>
+       The <a 
href="https://www.php.net/manual/en/install.windows.building.php";>instructions 
for compiling from source
+       on Windows</a> are described in the PHP manual.
+</p>

Reply via email to