Skip to content

Commit fa3933b

Browse files
committed
Add 'source' checkbox, and add direct link to source tarballs
1 parent 8d8dc01 commit fa3933b

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

downloads-get-instructions.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@
3737
$multiversion = $options['multiversion'] === 'Y';
3838
}
3939

40+
$source = false;
41+
42+
if (array_key_exists('source', $options)) {
43+
if ($options['source'] === 'Y') {
44+
$source = $options['source'] === 'Y';
45+
}
46+
}
47+
4048
switch ($options['os']) {
4149
case 'linux':
4250
$defaultOrCommunity = ($options['version'] !== 'default' || $multiversion) ? 'community' : 'default';
@@ -51,16 +59,23 @@
5159
break;
5260
}
5361

62+
if ($source) {
63+
$file = "{$options['os']}-source";
64+
}
65+
5466
$version = $options['version'];
5567
$versionNoDot = str_replace('.', '', $version);
5668

5769
if (file_exists(__DIR__ . "/include/download-instructions/{$file}.php")) {
5870
include __DIR__ . "/include/download-instructions/{$file}.php";
71+
if ($source) {
72+
return false;
73+
}
5974
return true;
6075
} else {
6176
?>
6277
<p>
63-
There are no instructions yet. Try using the generic installation from source.
78+
There are no instructions yet. Try using the <a href="https://www.php.net/manual/en/install.php">generic installation from source</a>.
6479
</p>
6580
<?php
6681
return false;

downloads.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
</div>
1717
</div>
1818
19+
<p class="panel"><a href="downloads.php?source=Y">Source Tarballs</a></p>
1920
<p class="panel"><a href="download-docs.php">Documentation Download</a></p>
2021
<p class="panel"><a href="download-logos.php">PHP Logos</a></p>
2122
@@ -156,13 +157,13 @@ function option(string $value, string $desc, $attributes = []): string
156157
<input type="checkbox" id="multiversion" name="multiversion" value="Y"
157158
<?= array_key_exists('multiversion', $options) && $options['multiversion'] === 'Y' ? 'checked' : '' ?>/>
158159
</label>
159-
<!--
160+
160161
<label for="source" class="instructions-label">
161162
I want to compile everything from source:
162163
<input type="checkbox" id="source" name="source" value="Y"
163164
<?= array_key_exists('source', $options) && $options['source'] === 'Y' ? 'checked' : '' ?>/>
164165
</label>
165-
-->
166+
166167
<noscript>
167168
<button type="submit" class="button">Update Instructions</button>
168169
</noscript>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<p>
2+
The <a href="https://www.php.net/manual/en/install.unix.source.php">instructions for compiling from source
3+
on Linux</a> are described in the PHP manual.
4+
</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<p>
2+
The <a href="https://www.php.net/manual/en/install.unix.source.php">instructions for compiling from source
3+
on macOS</a> are described in the PHP manual.
4+
</p>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<p>
2+
The <a href="https://www.php.net/manual/en/install.windows.building.php">instructions for compiling from source
3+
on Windows</a> are described in the PHP manual.
4+
</p>

0 commit comments

Comments
 (0)