Skip to content

Commit bfd8d5c

Browse files
committed
Update version to 11.5 in composer.json; Update Starttime calulation mechanism
1 parent ff61fc5 commit bfd8d5c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"email": "anshu.krishna5@gmail.com"
1010
}
1111
],
12-
"version": "11.4.1",
12+
"version": "11.5",
1313
"minimum-stability": "stable",
1414
"require": {
1515
"php": ">=8.1",

src/Server.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public static function init(?string $func_base_path = null) :void {
3939
return;
4040
}
4141
// Init flags and constants
42-
define(__NAMESPACE__ . '\\__START_TIME__', microtime(true));
42+
$startTime = $_SERVER['REQUEST_TIME_FLOAT'] ?? microtime(true);
43+
define(__NAMESPACE__ . '\\__START_TIME__', $startTime);
4344
self::$init_flag = true;
4445

4546
// Init error management
@@ -188,6 +189,7 @@ private static function _default_final_writer_(mixed $value = null, StatusType $
188189

189190
if(Config::$dev_mode) {
190191
$response['meta'] = [];
192+
191193
if(defined(__NAMESPACE__ . '\\__START_TIME__')) {
192194
$response['meta']['exe_time'] = round(microtime(true) - constant(__NAMESPACE__ . '\\__START_TIME__'), 7);
193195
}
@@ -236,6 +238,7 @@ private static function final_writer(mixed $value = null, StatusType $status = S
236238
&& (ini_get('output_handler') != 'ob_gzhandler')
237239
) {
238240
@ini_set('zlib.output_compression', 1);
241+
$headers[] = 'Content-Encoding: gzip';
239242
}
240243
}
241244
if(Config::$disable_caching === true) {

0 commit comments

Comments
 (0)