Skip to content
Draft
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
18 changes: 18 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM php:8.5-cli

ARG DEBIAN_FRONTEND=noninteractive

# 2. Install system dependencies and Node.js/npm
# We are using Node.js 22 LTS as a reliable, modern standard
RUN apt-get update && apt-get install -y \
curl gnupg \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/lists/*

# 3. Globally install TypeScript and the Socket Dev CLI
RUN npm install -g typescript socket tsx esbuild
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see this being used anywhere. Do we need to add this Docker file?

Copy link
Copy Markdown
Author

@markrandall markrandall Jun 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a leftover from hacking together a local dev environment - I strongly prefer to run all such projects (and their toolchains) inside containers as a standard security precaution.

I'll either polish it up for broader use, or remove it, prior to marking the PR as ready.


# 4. Set up a default working directory (Optional)
WORKDIR /app
7 changes: 7 additions & 0 deletions .router.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@

$filename = $_SERVER["PATH_INFO"] ?? $_SERVER["SCRIPT_NAME"];

//die(print_r($_SERVER, true));

//$_SERVER['HTTP_HOST'] = '';
//$_SERVER['BASE_PAGE'] = '/';
//$_SERVER['SERVER_NAME'] = 'localhost';

if (!file_exists($_SERVER["DOCUMENT_ROOT"] . $filename)) {
require_once __DIR__ . '/error.php';

return;
}


/* This could be an image or whatever, so don't try to compress it */
ini_set("zlib.output_compression", 0);
return false;
19 changes: 19 additions & 0 deletions bin/createNewsEntry
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ function parseOptions(): Entry {
echo " --conf-time 'value' When the event will be occurign (cfp and conference categories only)\n";
echo " --content 'value' Text content for the entry, may include XHTML\n";
echo " --content-file 'value' Name of file to load content from, may not be specified with --content\n";
echo " --summary 'value' Short, plain-text summary of the content. Should be a single line.\n";
echo " --summary-file 'value' Name of the file to load summary content from, should be a plain-text summary of the content. Should be a single line.\n";
echo " --image-path 'value' Basename of image file in " . Entry::IMAGE_PATH_REL . "\n";
echo " --image-title 'value' Title for the image provided\n";
echo " --image-link 'value' URI to direct to when clicking the image\n";
Expand Down Expand Up @@ -238,5 +240,22 @@ function parseOptions(): Entry {
exit(1);
}

$summary = $opts['summary'] ?? '';
$summaryFile = $opts['summary-file'] ?? '';
if ($summary && $summaryFile) {
fwrite(STDERR, "--summary and --summary-file may not be specified together\n");
exit(1);
} elseif ($summaryFile) {
$summary = file_get_contents($summaryFile);
if ($summary === false) {
fwrite(STDERR, "Summary cannot be opened, or must not be empty\n");
exit(1);
}
}

if ($summary) {
$entry->setSummary($summary);
}

return $entry;
}
70 changes: 31 additions & 39 deletions docs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,46 @@

site_header("Documentation", ["current" => "docs"]);

$lang = Languages::ACTIVE_ONLINE_LANGUAGES_EX['en'];
?>

<h1>Documentation</h1>
<div class="content-box">

<p>
The PHP Manual is available online in a selection of languages.
Please pick a language from the list below.
</p>

<p>
Note, that many languages are just under translation, and
the untranslated parts are still in English. Also some translated
parts might be outdated. The translation teams are
<a href="https://doc.php.net/">open to contributions</a>.
</p>
<p>PHP Translates its documentation into many different languages, but the main reference is in English</p>
<div style="display: flex; flex-direction: row; flex: 1 0 250px; border-radius: 0.5em; background: white; padding: 1em; gap: 1em; align-items: center">
<img style="max-width: 100px; max-height: 80px; object-fit: contain" src="<?= htmlspecialchars($lang['icon'])?>" alt="Flag of <?= htmlspecialchars($lang['label_loc'])?>" />
<div style="flex: 1 1; display: flex; flex-direction: column">
<div style="font-size: 125%; font-weight: bold"><?= htmlspecialchars($lang['label_loc']) ?></div>
<div style="font-size: larger"><?= htmlspecialchars($lang['label_en']) ?></div>
</div>
</div>
<br />

<p>
View Online:
<?php

// List all manual languages viewable online
$lastlang = array_key_last(Languages::ACTIVE_ONLINE_LANGUAGES);
foreach (Languages::ACTIVE_ONLINE_LANGUAGES as $langcode => $langname) {
if (!file_exists($_SERVER["DOCUMENT_ROOT"] . "/manual/{$langcode}/index.php")) {
continue;
}

// Make preferred language bold
if ($langcode === $LANG) { echo "<strong>"; }

echo '<a href="/manual/' . $langcode . '/">' . $langname . '</a>';
echo ($lastlang !== $langcode) ? ",\n" : "\n";

if ($langcode === $LANG) { echo "</strong>"; }
}
<h1>Available Languages</h1>
<div class="content-box">
<p>
Note, that many languages are just under translation, and
the untranslated parts are still in English. Also some translated
parts might be outdated. The translation teams are
<a href="https://doc.php.net/">open to contributions</a>.
</p>
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1em">
<?php foreach (Languages::ACTIVE_ONLINE_LANGUAGES_EX as $langId => $lang) { ?>
<div style="display: flex; flex-direction: row; flex: 1 0 250px; border-radius: 0.5em; background: white; padding: 1em; gap: 1em; align-items: center">
<img style="max-width: 100px; max-height: 80px; object-fit: contain" src="<?= htmlspecialchars($lang['icon'])?>" alt="Flag of <?= htmlspecialchars($lang['label_loc'])?>" />
<div style="flex: 1 1; display: flex; flex-direction: column">
<div style="font-size: 125%; font-weight: bold"><?= htmlspecialchars($lang['label_loc']) ?></div>
<div style="font-size: larger"><?= htmlspecialchars($lang['label_en']) ?></div>
</div>
</div>
<?php } ?>
</div>
<br /><br />

?>
</p>
</div>

<p>
The language currently being used as the default for you should be in
<strong>bold</strong> above. You can change the setting for this on the
<a href="/my.php">My PHP.net customization page</a>.
</p>

<p>
<h2>More Options</h2>
For downloadable formats, please visit our
<a href="download-docs.php">documentation downloads</a> page.
</p>
Expand Down
Binary file added images/landing/contribute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/landing/docs-translator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions images/landing/externals-io.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/landing/php-bugs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/br.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/en.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/it.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/ja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/ru.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/tr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/uk.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/language-flags/zh.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logos/composer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions images/logos/github_invertocat_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions images/logos/php-foundation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logos/phpc-discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/logos/reddit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading