[web-doc] fix/cache: Refactor site_header to accept configuration array and update Cache-Control handling in revcheck.php
| From: | Luffy | Date: | Wed, 02 Sep 2026 03:08:32 +0000 |
| Subject: | [web-doc] fix/cache: Refactor site_header to accept configuration array and update Cache-Control handling in revcheck.php | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-2551@lists.php.net to get a copy of this message | ||
Author: Luffy (sy-records)
Date: 2026-09-02T11:06:58+08:00
Commit: https://github.com/php/web-doc/commit/b57ed739438e7a8cb47b77df6e6a310a2014ed33
Raw diff: https://github.com/php/web-doc/commit/b57ed739438e7a8cb47b77df6e6a310a2014ed33.diff
Refactor site_header to accept configuration array and update Cache-Control handling in revcheck.php
Changed paths:
M include/lib_general.inc.php
M www/revcheck.php
Diff:
diff --git a/include/lib_general.inc.php b/include/lib_general.inc.php
index af48826..603bec8 100644
--- a/include/lib_general.inc.php
+++ b/include/lib_general.inc.php
@@ -28,7 +28,7 @@ function get_svn_dir($project)
return $GLOBALS['PROJECTS'][$project][1] . '/';
}
-function site_header()
+function site_header(array $config = [])
{
$TITLE = 'Documentation Tools';
$SUBDOMAIN = 'doc';
@@ -38,6 +38,7 @@ function site_header()
array('href' => '/revcheck.php', 'text' =>
'Translation Status'),
array('href' => '/phd.php', 'text' => 'PhD
Homepage'),
);
+ $CONFIG = $config;
require __DIR__ . '/../shared/templates/header.inc';
echo <<<END_OF_MULTILINE
diff --git a/www/revcheck.php b/www/revcheck.php
index daf2dc2..229297d 100644
--- a/www/revcheck.php
+++ b/www/revcheck.php
@@ -51,8 +51,7 @@
die;
}
-site_header();
-header('Cache-Control: public, max-age=3600');
+site_header(['cache_control' => 3600]);
switch($tool) {
case 'translators':
$translators = get_translators($dbhandle, $lang);