|
1 | 1 | <?php |
| 2 | + |
| 3 | +use phpweb\Releases\SupportState; |
| 4 | +use phpweb\Releases\VersionData; |
| 5 | + |
2 | 6 | $_SERVER['BASE_PAGE'] = 'eol.php'; |
3 | 7 |
|
4 | 8 | include_once __DIR__ . '/include/prepend.inc'; |
5 | | -include_once __DIR__ . '/include/branches.inc'; |
6 | 9 |
|
7 | 10 | // Notes for specific branches can be added here, and will appear in the table. |
8 | 11 | $BRANCH_NOTES = [ |
|
23 | 26 | '4.4' => '<a href="https://php-legacy-docs.zend.com/manual/php5/en/migration5">A guide is available for migrating from PHP 4 to 5.0.</a>', |
24 | 27 | ]; |
25 | 28 |
|
| 29 | +$releases = array_filter(VersionData::all(), fn(VersionData $version) => $version->supportState === SupportState::Eol); |
| 30 | +$releases = VersionData::sort($releases, 'desc'); |
| 31 | + |
26 | 32 | site_header('Unsupported Branches'); |
27 | 33 | ?> |
28 | 34 |
|
|
36 | 42 | more recent versions of PHP. |
37 | 43 | </p> |
38 | 44 |
|
39 | | -<table class="standard"> |
| 45 | +<table class="standard" style="width: 100%"> |
40 | 46 | <thead> |
41 | 47 | <tr> |
42 | 48 | <th>Branch</th> |
|
46 | 52 | </tr> |
47 | 53 | </thead> |
48 | 54 | <tbody> |
49 | | - <?php foreach (get_eol_branches() as $major => $branches): ?> |
50 | | - <?php foreach ($branches as $branch => $detail): ?> |
51 | | - <?php $eolDate = get_branch_security_eol_date($branch) ?> |
52 | | - <?php $eolPeriod = format_interval($eolDate, new DateTime('now')) ?> |
53 | | - <tr> |
54 | | - <td><?php echo htmlspecialchars($branch); ?></td> |
55 | | - <td> |
56 | | - <?php echo $eolDate->format('j M Y') ?> |
57 | | - <br/> |
58 | | - <em>(<?php echo $eolPeriod ?>)</em> |
59 | | - </td> |
60 | | - <td> |
61 | | - <a href="<?php echo htmlspecialchars($detail['link']); ?>"> |
62 | | - <?php echo htmlspecialchars($detail['version']); ?> |
63 | | - </a> |
64 | | - </td> |
65 | | - <td> |
66 | | - <?php echo $BRANCH_NOTES[$branch] ?? ''; ?> |
67 | | - </td> |
68 | | - </tr> |
69 | | - <?php endforeach ?> |
70 | | - <?php endforeach ?> |
| 55 | + <?php foreach ($releases as $release) { ?> |
| 56 | + <?php $eolDate = $release->securityEOL ?> |
| 57 | + <?php $eolPeriod = format_interval($eolDate, new DateTime('now')) ?> |
| 58 | + <tr> |
| 59 | + <td><?= safe($release->label) ?></td> |
| 60 | + <td> |
| 61 | + <?= safe($eolDate->format('j M Y')) ?> |
| 62 | + <br/> |
| 63 | + <em>(<?= safe($eolPeriod) ?>)</em> |
| 64 | + </td> |
| 65 | + <td> |
| 66 | + <?php if ($release->latestRelease) { ?> |
| 67 | + <a href="<?= safe($release->latestRelease->announcementUrl); ?>"> |
| 68 | + <?= safe($release->latestRelease->label) ?> |
| 69 | + </a> |
| 70 | + <?php } ?> |
| 71 | + </td> |
| 72 | + <td><?= $BRANCH_NOTES[$release->label] ?? '' ?></td> |
| 73 | + </tr> |
| 74 | + <?php } ?> |
71 | 75 | </tbody> |
72 | 76 | </table> |
73 | 77 |
|
|
0 commit comments