mirror of
https://github.com/dunglas/frankenphp
synced 2024-11-23 08:39:21 +00:00
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
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:
parent
fa64198d52
commit
0c123a2563
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user