|
31 | 31 | #include "zend_virtual_cwd.h"
|
32 | 32 | #include "ext/standard/info.h"
|
33 | 33 | #include "ext/standard/php_filestat.h"
|
| 34 | +#include "ext/date/php_date.h" |
34 | 35 | #include "opcache_arginfo.h"
|
35 | 36 |
|
36 | 37 | #if HAVE_JIT
|
@@ -461,6 +462,9 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
461 | 462 | php_info_print_table_row(2, "Startup Failed", zps_api_failure_reason);
|
462 | 463 | } else {
|
463 | 464 | char buf[32];
|
| 465 | + zend_string *start_time, *restart_time, *force_restart_time; |
| 466 | + zval *date_ISO8601 = zend_get_constant_str("DATE_ISO8601", sizeof("DATE_ISO8601")-1); |
| 467 | + |
464 | 468 | php_info_print_table_row(2, "Startup", "OK");
|
465 | 469 | php_info_print_table_row(2, "Shared memory model", zend_accel_get_shared_model());
|
466 | 470 | snprintf(buf, sizeof(buf), ZEND_ULONG_FMT, ZCSG(hits));
|
@@ -491,6 +495,26 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
|
491 | 495 | php_info_print_table_row(2, "Hash keys restarts", buf);
|
492 | 496 | snprintf(buf, sizeof(buf), ZEND_ULONG_FMT, ZCSG(manual_restarts));
|
493 | 497 | php_info_print_table_row(2, "Manual restarts", buf);
|
| 498 | + |
| 499 | + start_time = php_format_date(Z_STRVAL_P(date_ISO8601), Z_STRLEN_P(date_ISO8601), ZCSG(start_time), 1); |
| 500 | + php_info_print_table_row(2, "Start time", ZSTR_VAL(start_time)); |
| 501 | + zend_string_release(start_time); |
| 502 | + |
| 503 | + if (ZCSG(last_restart_time)) { |
| 504 | + restart_time = php_format_date(Z_STRVAL_P(date_ISO8601), Z_STRLEN_P(date_ISO8601), ZCSG(last_restart_time), 1); |
| 505 | + php_info_print_table_row(2, "Last restart time", ZSTR_VAL(restart_time)); |
| 506 | + zend_string_release(restart_time); |
| 507 | + } else { |
| 508 | + php_info_print_table_row(2, "Last restart time", "none"); |
| 509 | + } |
| 510 | + |
| 511 | + if (ZCSG(force_restart_time)) { |
| 512 | + force_restart_time = php_format_date(Z_STRVAL_P(date_ISO8601), Z_STRLEN_P(date_ISO8601), ZCSG(force_restart_time), 1); |
| 513 | + php_info_print_table_row(2, "Last force restart time", ZSTR_VAL(force_restart_time)); |
| 514 | + zend_string_release(force_restart_time); |
| 515 | + } else { |
| 516 | + php_info_print_table_row(2, "Last force restart time", "none"); |
| 517 | + } |
494 | 518 | }
|
495 | 519 | }
|
496 | 520 |
|
|
0 commit comments