mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
remove opcache_reset (#1173)
* remove opcache_reset * reset opcache if the function exists * simplify the check * reformat
This commit is contained in:
@@ -1169,3 +1169,11 @@ int frankenphp_execute_php_function(const char *php_function) {
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
int frankenphp_reset_opcache(void) {
|
||||
if (zend_hash_str_exists(CG(function_table), "opcache_reset",
|
||||
sizeof("opcache_reset") - 1)) {
|
||||
return frankenphp_execute_php_function("opcache_reset");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -66,5 +66,6 @@ void frankenphp_register_trusted_var(zend_string *z_key, char *value,
|
||||
int val_len, zval *track_vars_array);
|
||||
zend_string *frankenphp_init_persistent_string(const char *string, size_t len);
|
||||
void frankenphp_release_zend_string(zend_string *z_string);
|
||||
int frankenphp_reset_opcache(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -289,7 +289,7 @@ func go_frankenphp_worker_handle_request_start(threadIndex C.uintptr_t) C.bool {
|
||||
c.Write(zap.String("worker", thread.worker.fileName))
|
||||
}
|
||||
thread.worker = nil
|
||||
executePHPFunction("opcache_reset")
|
||||
C.frankenphp_reset_opcache()
|
||||
|
||||
return C.bool(false)
|
||||
case r = <-thread.worker.requestChan:
|
||||
|
||||
Reference in New Issue
Block a user