Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "zend_compile.h"
#include "ZendAccelerator.h"
#include "zend_persist.h"
#include "zend_portability.h"
#include "zend_shared_alloc.h"
#include "zend_accelerator_module.h"
#include "zend_accelerator_blacklist.h"
Expand Down Expand Up @@ -3410,6 +3411,8 @@ void accel_shutdown(void)
}
}

ZEND_EXT_API void (*zend_accel_schedule_restart_hook)(zend_accel_restart_reason reason);

void zend_accel_schedule_restart(zend_accel_restart_reason reason)
{
const char *zend_accel_restart_reason_text[ACCEL_RESTART_USER + 1] = {
Expand All @@ -3418,6 +3421,10 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason)
"user",
};

if (UNEXPECTED(zend_accel_schedule_restart_hook)) {
zend_accel_schedule_restart_hook(reason);
}

if (ZCSG(restart_pending)) {
/* don't schedule twice */
return;
Expand Down
3 changes: 2 additions & 1 deletion ext/opcache/ZendAccelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ extern const char *zps_api_failure_reason;
BEGIN_EXTERN_C()

void accel_shutdown(void);
zend_result accel_activate(INIT_FUNC_ARGS);
zend_result accel_activate(INIT_FUNC_ARGS);
zend_result accel_post_deactivate(void);
extern ZEND_EXT_API void (*zend_accel_schedule_restart_hook)(zend_accel_restart_reason reason);
void zend_accel_schedule_restart(zend_accel_restart_reason reason);
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size);
Expand Down