-
Notifications
You must be signed in to change notification settings - Fork 589
[WIP] PHP 8.5 release page #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2614191
ec7b3ef
5fc81d6
1027001
4c0fe2b
6e7045f
b655856
7301dd8
d525379
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace releases\php85; | ||
|
||
include_once __DIR__ . '/../../include/prepend.inc'; | ||
|
||
const LANGUAGES = [ | ||
'en' => 'English', | ||
]; | ||
|
||
function common_header(string $description): void { | ||
global $MYSITE; | ||
|
||
$meta_image_path = \htmlspecialchars( | ||
\filter_var($MYSITE . 'images/php8/php_8_5_released.png', \FILTER_VALIDATE_URL)); | ||
$meta_description = \htmlspecialchars($description); | ||
|
||
\site_header("PHP 8.5 Release Announcement", [ | ||
'current' => 'php8', | ||
'css' => ['php8.css'], | ||
'meta_tags' => <<<META | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:site" content="@official_php" /> | ||
<meta name="twitter:title" content="PHP 8.5 Released" /> | ||
<meta name="twitter:description" content="{$meta_description}" /> | ||
<meta name="twitter:creator" content="@official_php" /> | ||
<meta name="twitter:image:src" content="{$meta_image_path}" /> | ||
|
||
<meta itemprop="name" content="PHP 8.5 Released" /> | ||
<meta itemprop="description" content="{$meta_description}" /> | ||
<meta itemprop="image" content="{$meta_image_path}" /> | ||
|
||
<meta property="og:image" content="{$meta_image_path}" /> | ||
<meta property="og:description" content="{$meta_description}" /> | ||
META | ||
]); | ||
} | ||
|
||
function language_chooser(string $currentLang): void { | ||
// Print out the form with all the options | ||
echo ' | ||
<form action="" method="get" id="changelang" name="changelang"> | ||
<fieldset> | ||
<label for="changelang-langs">Change language:</label> | ||
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs"> | ||
'; | ||
|
||
$tab = ' '; | ||
foreach (LANGUAGES as $lang => $text) { | ||
$selected = ($lang === $currentLang) ? ' selected="selected"' : ''; | ||
echo $tab, "<option value='$lang'$selected>$text</option>\n"; | ||
} | ||
|
||
echo ' </select> | ||
</fieldset> | ||
</form> | ||
'; | ||
} | ||
|
||
function message($code, $language = 'en') | ||
{ | ||
$original = require __DIR__ . '/languages/en.php'; | ||
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) { | ||
$translation = require __DIR__ . '/languages/' . $language . '.php'; | ||
} | ||
|
||
return $translation[$code] ?? $original[$code] ?? $code; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
$lang = 'en'; | ||
|
||
include_once __DIR__ . '/release.inc'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use phpweb\LangChooser; | ||
use const releases\php85\LANGUAGES; | ||
|
||
$_SERVER['BASE_PAGE'] = 'releases/8.5/index.php'; | ||
require_once __DIR__ . '/common.php'; | ||
require_once __DIR__ . '/../../src/autoload.php'; | ||
|
||
$langChooser = new LangChooser(LANGUAGES, [], "", ""); | ||
[$lang,] = $langChooser->chooseCode("", "", $_SERVER['HTTP_ACCEPT_LANGUAGE']); | ||
|
||
mirror_redirect("/releases/8.5/$lang.php"); |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,27 @@ | ||||||
<?php | ||||||
|
||||||
return [ | ||||||
'common_header' => 'PHP 8.5 is a major update of the PHP language. It contains many new features, such as the new URI extension, support for modifying properties while cloning, the Pipe operator, performance improvements, bug fixes, and general cleanup.', | ||||||
'documentation' => 'Doc', | ||||||
'main_title' => 'Released!', | ||||||
'main_subtitle' => 'PHP 8.5 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as the new URI extension, support for modifying properties while cloning, the Pipe operator, performance improvements, bug fixes, and general cleanup.', | ||||||
'upgrade_now' => 'Upgrade to PHP 8.5 now!', | ||||||
|
||||||
'pipe_operator_title' => 'Pipe operator', | ||||||
'url_parsing_api_title' => 'Add RFC 3986 and WHATWG URL compliant API', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'url_parsing_api_description' => '<code>Uri\UriException</code>, <code>Uri\InvalidUriException</code>, <code>Uri\UriComparisonMode</code>, | ||||||
<code>Uri\Rfc3986\Uri</code>, <code>Uri\WhatWg\InvalidUrlException</code>, <code>Uri\WhatWg\UrlValidationErrorType</code>, <code>Uri\WhatWg\UrlValidationError</code>, and <code>Uri\WhatWg\Url</code> are now available.', | ||||||
'clone_with_title' => 'Clone with v2', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I don't think we need the v2 here, since this is intended for the end user, not the folks who actually read RFCs 😀 |
||||||
'no_discard_title' => 'New <code>#[\NoDiscard]</code> Attribute', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'fcc_in_const_expr_title' => 'First Class Callables in constant expressions', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'curl_share_persistence_improvement_title' => 'Persistent cURL share handle improvement', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
'array_first_last_title' => 'New <code>array_first()</code> and <code>array_last()</code> functions', | ||||||
|
||||||
'new_classes_title' => 'New Classes, Interfaces, and Functions', | ||||||
|
||||||
'bc_title' => 'Deprecations and backward compatibility breaks', | ||||||
|
||||||
'footer_title' => 'Better performance, better syntax, improved type safety.', | ||||||
'footer_description' => '<p>For source downloads of PHP 8.5 please visit the <a href="/downloads">downloads</a> page. Windows binaries can be found on the <a href="https://windows.php.net/download">PHP for Windows</a> site. The list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_5">ChangeLog</a>.</p> | ||||||
<p>The <a href="/manual/en/migration85.php">migration guide</a> is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.</p>', | ||||||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.