Update various controllers and scripts; modify last modified dates, enhance JSON responses, and adjust PPN handling for improved functionality

This commit is contained in:
2026-11-04 11:14:12 +07:00
parent 4344b53de8
commit eab5acde17
11 changed files with 84 additions and 41 deletions
+6 -3
View File
@@ -5,7 +5,7 @@
Desc. : Loading Routing Setup
Created By : Siau Pheng ([email protected]).
Created Date : November 23rd, 2019.
Last Modified : October 21st, 2026.
Last Modified : November 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
@@ -130,8 +130,11 @@ $router->group('', function(Router $router) use ($app, $session, $config) {
$mimeType = 'application/octet-stream';
if (str_ends_with($filePath, '.js')) $mimeType = 'application/javascript';
if (str_ends_with($filePath, '.css')) $mimeType = 'text/css';
$app->response()->header('Content-Type', $mimeType);
echo file_get_contents($filePath);
$app->response()->header('Content-Type', $mimeType.'; charset=utf-8');
if (function_exists('gzencode') && str_contains($_SERVER['HTTP_ACCEPT_ENCODING'] ?? '', 'gzip')) {
$app->response()->header('Content-Encoding', 'gzip');
echo gzencode(file_get_contents($filePath), 9);
} else echo file_get_contents($filePath);
} else {
$app->notFound();
}