remove opcache_reset (#1173)
Some checks failed
Lint Code Base / Lint Code Base (push) Waiting to run
Sanitizers / ${{ matrix.sanitizer }} (asan) (push) Has been cancelled
Sanitizers / ${{ matrix.sanitizer }} (msan) (push) Has been cancelled
Tests / tests (8.2) (push) Has been cancelled
Tests / tests (8.3) (push) Has been cancelled
Tests / tests (8.4) (push) Has been cancelled

* remove opcache_reset

* reset opcache if the function exists

* simplify the check

* reformat
This commit is contained in:
Rob Landers 2024-11-17 19:19:53 +01:00 committed by GitHub
parent fa64198d52
commit 0c123a2563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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: