Skip to content

Commit be98d3d

Browse files
committed
Start PHP 8.2 Release page
1 parent b8c35de commit be98d3d

File tree

10 files changed

+596
-3
lines changed

10 files changed

+596
-3
lines changed

images/php8/logo_php8_2.svg

Lines changed: 32 additions & 0 deletions
Loading

images/php8/php_8_2_released.png

9.65 KB
Loading

include/header.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ if (!isset($config["languages"])) {
105105
<li class="<?php echo $curr == "community" ? "active" : ""?>"><a href="/get-involved" >Get Involved</a></li>
106106
<li class="<?php echo $curr == "help" ? "active" : ""?>"><a href="/support">Help</a></li>
107107
<li class="<?php echo $curr === "php8" ? "active" : "" ?>">
108-
<a href="/releases/8.1/index.php">
109-
<img src="/images/php8/logo_php8_1.svg" alt="php8.1" height="22" width="60">
108+
<a href="/releases/8.2/index.php">
109+
<img src="/images/php8/logo_php8_2.svg" alt="php8.2" height="22" width="60">
110110
</a>
111111
</li>
112112
</ul>

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<img class="hero-logo" src="/images/logos/php-logo-white.svg" alt="php" width="240" height="120">
9696
<p class="hero-text">A <strong>popular general-purpose scripting language</strong> that is especially suited to web development.<br />Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.</p>
9797
<div class="hero-actions">
98-
<a href="/releases/8.1/index.php" class="hero-btn hero-btn-primary">What's new in 8.1</a>
98+
<a href="/releases/8.2/index.php" class="hero-btn hero-btn-primary">What's new in 8.2</a>
9999
<a href="/downloads.php" class="hero-btn hero-btn-secondary">Download</a>
100100
</div>
101101
EOF;

releases/8.2/common.php

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace releases\php82;
4+
5+
include_once __DIR__ . '/../../include/prepend.inc';
6+
7+
function language_redirect(string $currentLang): void {
8+
// We don't use the general language selection of php.net,
9+
// so soldier on with this one.
10+
return;
11+
}
12+
13+
function common_header(string $description): void {
14+
global $MYSITE;
15+
16+
$meta_image_path = \htmlspecialchars(
17+
\filter_var($MYSITE . 'images/php8/php_8_2_released.png', \FILTER_VALIDATE_URL));
18+
$meta_description = \htmlspecialchars($description);
19+
20+
\site_header("PHP 8.2.0 Release Announcement", [
21+
'current' => 'php8',
22+
'css' => ['php8.css'],
23+
'meta_tags' => <<<META
24+
<meta name="twitter:card" content="summary_large_image" />
25+
<meta name="twitter:site" content="@official_php" />
26+
<meta name="twitter:title" content="PHP 8.2 Released" />
27+
<meta name="twitter:description" content="{$meta_description}" />
28+
<meta name="twitter:creator" content="@official_php" />
29+
<meta name="twitter:image:src" content="{$meta_image_path}" />
30+
31+
<meta itemprop="name" content="PHP 8.2 Released" />
32+
<meta itemprop="description" content="{$meta_description}" />
33+
<meta itemprop="image" content="{$meta_image_path}" />
34+
35+
<meta property="og:image" content="{$meta_image_path}" />
36+
<meta property="og:description" content="{$meta_description}" />
37+
META
38+
]);
39+
}
40+
41+
function language_chooser(string $currentLang): void {
42+
$LANGUAGES = [
43+
'en' => 'English',
44+
];
45+
46+
// Print out the form with all the options
47+
echo '
48+
<form action="" method="get" id="changelang" name="changelang">
49+
<fieldset>
50+
<label for="changelang-langs">Change language:</label>
51+
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs">
52+
';
53+
54+
$tab = ' ';
55+
foreach ($LANGUAGES as $lang => $text) {
56+
$selected = ($lang === $currentLang) ? ' selected="selected"' : '';
57+
echo $tab, "<option value='$lang'$selected>$text</option>\n";
58+
}
59+
60+
echo ' </select>
61+
</fieldset>
62+
</form>
63+
';
64+
}
65+
66+
function message($code, $language = 'en')
67+
{
68+
$original = require __DIR__ . '/languages/en.php';
69+
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) {
70+
$translation = require __DIR__ . '/languages/' . $language . '.php';
71+
}
72+
73+
return $translation[$code] ?? $original[$code] ?? $code;
74+
}

releases/8.2/en.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
$lang = 'en';
4+
5+
include_once __DIR__ . '/release.inc';

releases/8.2/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
$_SERVER['BASE_PAGE'] = 'releases/8.2/index.php';
3+
include (__DIR__ . '/../../include/site.inc');
4+
5+
mirror_redirect('/releases/8.2/en.php');

releases/8.2/languages/en.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
return [
4+
'common_header' => 'PHP 8.2 is a major update of the PHP language. Readonly classes, null, false, and true as stand-alone types, deprecated dynamic properties, performance improvements and more',
5+
'documentation' => 'Doc',
6+
];

0 commit comments

Comments
 (0)