|
7 | 7 | // Try to make this page non-cached |
8 | 8 | header_nocache(); |
9 | 9 |
|
10 | | -$SHOW_COUNT = 4; |
11 | | - |
12 | 10 | $SIDEBAR_DATA = ' |
13 | 11 | <div class="panel"> |
14 | 12 | <a href="/supported-versions.php">Supported Versions</a> |
|
37 | 35 | ], |
38 | 36 | ], |
39 | 37 | "current" => "downloads", |
| 38 | + "js_files" => [ |
| 39 | + "/js/version-choice.js", |
| 40 | + ], |
40 | 41 | ], |
41 | 42 | ); |
| 43 | + |
| 44 | +function option(string $id, string $value, string $desc) |
| 45 | +{ |
| 46 | + $selected = ''; |
| 47 | + if (array_key_exists($id, $_GET) && $_GET[$id] === $value) { |
| 48 | + $selected = ' selected'; |
| 49 | + } |
| 50 | + |
| 51 | + echo <<<ENDOPT |
| 52 | + <option value="{$value}"{$selected}>{$desc}</option> |
| 53 | +
|
| 54 | +ENDOPT; |
| 55 | +} |
42 | 56 | ?> |
43 | 57 | <h1>Downloads & Installation Instructions</h1> |
44 | 58 |
|
| 59 | +<form> |
| 60 | +Get PHP for |
| 61 | +<select id="os" name="os"> |
| 62 | + <?= option('os', 'linux', 'Linux'); ?> |
| 63 | + <?= option('os', 'osx', 'OSX'); ?> |
| 64 | + <?= option('os', 'windows', 'Windows'); ?> |
| 65 | +</select> |
| 66 | + |
| 67 | +<select id="osvariant" name="osvariant"> |
| 68 | + <?= option('osvariant', 'linux-deb-buster', 'Debian Buster'); ?> |
| 69 | + <?= option('osvariant', 'linux-deb-bullseye', 'Debian Bullseye'); ?> |
| 70 | + <?= option('osvariant', 'linux-deb-bookworm', 'Debian Bookworm'); ?> |
| 71 | + <?= option('osvariant', 'linux-rpm-fedora41', 'Fedora 41'); ?> |
| 72 | + <?= option('osvariant', 'linux-rpm-fedora42', 'Fedora 42'); ?> |
| 73 | + <?= option('osvariant', 'linux-rpm-redhat', 'RedHat'); ?> |
| 74 | + <?= option('osvariant', 'osx-latest', 'Latest'); ?> |
| 75 | + <?= option('osvariant', 'windows-wsl', 'with WSL'); ?> |
| 76 | + <?= option('osvariant', 'windows-normal', 'without WSL'); ?> |
| 77 | +</select> |
| 78 | + |
| 79 | +to work on |
| 80 | +<select id="usage" name="usage"> |
| 81 | + <?= option('usage', 'web', 'Web Development'); ?> |
| 82 | + <?= option('usage', 'cli', 'Command Line Libraries'); ?> |
| 83 | + <?= option('usage', 'fw-drupal', 'Drupal'); ?> |
| 84 | + <?= option('usage', 'fw-laravel', 'Laravel'); ?> |
| 85 | + <?= option('usage', 'fw-symfony', 'Symfony'); ?> |
| 86 | +</select> |
| 87 | + |
| 88 | +with |
| 89 | +<select id="version" name="version"> |
| 90 | + <?= option('version', 'php84', 'version 8.4'); ?> |
| 91 | + <?= option('version', 'php83', 'version 8.3'); ?> |
| 92 | + <?= option('version', 'php82', 'version 8.2'); ?> |
| 93 | + <?= option('version', 'php81', 'version 8.1'); ?> |
| 94 | + <?= option('version', 'default', 'OS default version'); ?> |
| 95 | +</select> |
| 96 | + |
| 97 | +<input type='submit' value="Go!"></input> |
| 98 | + |
| 99 | +<br/> |
| 100 | + |
| 101 | +I want to have multiple versions at the same time: |
| 102 | +<input type="checkbox" id="multiversion" name="multiversion" label="I want to have multiple versions at the same time"> |
| 103 | +</input> |
| 104 | +</form> |
| 105 | + |
| 106 | +<h2>Instructions</h2> |
| 107 | +<div id="instructions"> |
| 108 | +<?php include 'downloads-get-instructions.php'; ?> |
| 109 | +</div> |
| 110 | + |
| 111 | +<!-- |
45 | 112 | <p> |
46 | 113 | <a href="/manual/install.general.php">Installing PHP</a> is covered |
47 | 114 | thoroughly in the PHP documentation. |
48 | 115 | </p> |
| 116 | +--> |
49 | 117 |
|
50 | 118 | <h2>Binaries</h2> |
51 | 119 |
|
|
66 | 134 | </p> |
67 | 135 |
|
68 | 136 | <h2>Source Code</h2> |
69 | | -<?php $i = 0; foreach ($RELEASES as $MAJOR => $major_releases): /* major releases loop start */ |
70 | | - $releases = array_slice($major_releases, 0, $SHOW_COUNT); |
71 | | -?> |
72 | | -<a id="v<?php echo $MAJOR; ?>"></a> |
73 | | -<?php foreach ($releases as $v => $a): ?> |
74 | | - <?php $mver = substr($v, 0, strrpos($v, '.')); ?> |
75 | | - <?php $stable = $i++ === 0 ? "Current Stable" : "Old Stable"; ?> |
76 | | - |
77 | | - <h3 id="v<?php echo $v; ?>" class="title"> |
78 | | - <span class="release-state"><?php echo $stable; ?></span> |
79 | | - PHP <?php echo $v; ?> |
80 | | - (<a href="/ChangeLog-<?php echo $MAJOR; ?>.php#<?php echo urlencode($v); ?>" class="changelog">Changelog</a>) |
81 | | - </h3> |
82 | | - <div class="content-box"> |
83 | | - |
84 | | - <ul> |
85 | | - <?php foreach ($a['source'] as $rel): ?> |
86 | | - <li> |
87 | | - <?php download_link($rel['filename'], $rel['filename']); ?> |
88 | | - <span class="releasedate"><?php echo date('d M Y', strtotime($rel['date'])); ?></span> |
89 | | - <?php |
90 | | - if (isset($rel['md5'])) echo '<span class="md5sum">', $rel['md5'], '</span>'; |
91 | | - if (isset($rel['sha256'])) echo '<span class="sha256">', $rel['sha256'], '</span>'; |
92 | | - ?> |
93 | | - <?php if (isset($rel['note']) && $rel['note']): ?> |
94 | | - <p> |
95 | | - <strong>Note:</strong> |
96 | | - <?php echo $rel['note']; ?> |
97 | | - </p> |
98 | | - <?php endif; ?> |
99 | | - </li> |
100 | | - <?php endforeach; ?> |
101 | | - <li> |
102 | | - <a href="https://windows.php.net/download#php-<?php echo urlencode($mver); ?>"> |
103 | | - Windows downloads |
104 | | - </a> |
105 | | - </li> |
106 | | - </ul> |
107 | | - |
108 | | - <a href="#gpg-<?php echo $mver; ?>">GPG Keys for PHP <?php echo $mver; ?></a> |
109 | | - </div> |
110 | | -<?php endforeach; ?> |
111 | | -<?php endforeach; /* major releases loop end */ ?> |
| 137 | +<?php show_source_releases(); ?> |
112 | 138 |
|
113 | 139 | <hr> |
114 | 140 | <h2>GPG Keys</h2> |
|
0 commit comments