Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/releases/8.2/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (!isset($lang)) {
$_SERVER['BASE_PAGE'] = 'releases/8.2/' . $lang . '.php';

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../../../include/branches.inc';

common_header(message('common_header', $lang));

Expand Down Expand Up @@ -265,6 +266,8 @@ echo ReleasePage::getFeatureComparisons($comparisons, 'PHP 8.2', 'PHP < 8.2');

<?php

echo ReleasePage::getSupportDetails('8.2');

echo ReleasePage::getPrefooter(
title: message('footer_title', $lang),
upgradeNow: message('upgrade_now', $lang),
Expand Down
3 changes: 3 additions & 0 deletions public/releases/8.3/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (!isset($lang)) {
$_SERVER['BASE_PAGE'] = 'releases/8.3/' . $lang . '.php';

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../../../include/branches.inc';

common_header(message('common_header', $lang));

Expand Down Expand Up @@ -355,6 +356,8 @@ echo ReleasePage::getFeatureComparisons($comparisons, 'PHP 8.3', 'PHP < 8.3');

<?php

echo ReleasePage::getSupportDetails('8.3');

echo ReleasePage::getPrefooter(
title: message('footer_title', $lang),
upgradeNow: message('upgrade_now', $lang),
Expand Down
3 changes: 3 additions & 0 deletions public/releases/8.4/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (!isset($documentation)) {
$_SERVER['BASE_PAGE'] = 'releases/8.4/' . $lang . '.php';

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../../../include/branches.inc';

common_header(message('common_header', $lang));

Expand Down Expand Up @@ -423,6 +424,8 @@ echo ReleasePage::getFeatureComparisons($comparisons, 'PHP 8.4', 'PHP < 8.4');

<?php

echo ReleasePage::getSupportDetails('8.4');

echo ReleasePage::getPrefooter(
title: message('footer_title', $lang),
upgradeNow: message('upgrade_now', $lang),
Expand Down
3 changes: 3 additions & 0 deletions public/releases/8.5/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (!isset($documentation)) {
$_SERVER['BASE_PAGE'] = 'releases/8.5/' . $lang . '.php';

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../../../include/branches.inc';

common_header(message('common_header', $lang));

Expand Down Expand Up @@ -439,6 +440,8 @@ echo ReleasePage::getHeroSection(
</section>
<?php

echo ReleasePage::getSupportDetails('8.5');

echo ReleasePage::getPrefooter(
title: message('footer_title', $lang),
upgradeNow: message('upgrade_now', $lang),
Expand Down
3 changes: 3 additions & 0 deletions public/releases/8.6/release.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (!isset($documentation)) {
$_SERVER['BASE_PAGE'] = 'releases/8.6/' . $lang . '.php';

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../../../include/branches.inc';

common_header(message('common_header', $lang));

Expand Down Expand Up @@ -592,6 +593,8 @@ echo ReleasePage::getHeroSection(
</section>
<?php

echo ReleasePage::getSupportDetails('8.6');

echo ReleasePage::getPrefooter(
title: message('footer_title', $lang),
upgradeNow: message('upgrade_now', $lang),
Expand Down
11 changes: 11 additions & 0 deletions public/styles/php85.css
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,17 @@ a {
color: var(--color-red-400)
}

.release-support-details {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
gap: 1rem;
margin-block: 1.5rem;
}

.release-support-details dt {
font-weight: var(--font-weight-semibold);
}

.release-notes h3 {
margin-bottom: calc(var(--spacing) * 2);
}
Expand Down
52 changes: 52 additions & 0 deletions src/Themes/ReleasePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,58 @@ public static function getHeroSection(
HTML;
}

public static function getSupportDetails(string $branch): string
{
$initial = get_branch_release_date($branch);
$activeEnd = get_branch_bug_eol_date($branch);
$securityEnd = get_branch_security_eol_date($branch);
$version = version_array($branch, 2);
$latest = get_current_release_for_branch($version[0], $version[1]);
if ($initial === null || $activeEnd === null || $securityEnd === null || $latest === null) {
return '';
}

$status = match (get_branch_support_state($branch)) {
'stable' => 'Active support',
'security' => 'Security fixes only',
'eol' => 'End of life',
'future' => 'Upcoming',
default => 'Unknown',
};
$latest = htmlspecialchars($latest);

return <<<HTML
<section class="release-notes" lang="en" aria-labelledby="support-details">
<div class="release-notes-grid-container">
<h2 id="support-details">Release and support details</h2>
<dl class="release-support-details">
<div>
<dt>Initial release</dt>
<dd><time datetime="{$initial->format('Y-m-d')}">{$initial->format('j M Y')}</time></dd>
</div>
<div>
<dt>Latest release</dt>
<dd>PHP {$latest}</dd>
</div>
<div>
<dt>Support status</dt>
<dd>{$status}</dd>
</div>
<div>
<dt>Active support ends</dt>
<dd><time datetime="{$activeEnd->format('Y-m-d')}">{$activeEnd->format('j M Y')}</time></dd>
</div>
<div>
<dt>Security support ends</dt>
<dd><time datetime="{$securityEnd->format('Y-m-d')}">{$securityEnd->format('j M Y')}</time></dd>
</div>
</dl>
<p><a href="/supported-versions.php">Supported PHP versions</a></p>
</div>
</section>
HTML;
}

public static function getPrefooter(string $title, string $upgradeNow, string $description, string $extraCredit = '', bool $isReleaseAvailable = true, string $unavailableReason = ''): string
{
$footer = fancy_footer($extraCredit);
Expand Down