com php-src: Add ext\opcache stubs: ext/opcache/opcache.stub.php ext/opcache/opcache_arginfo.h ext/opcache/zend_accelera tor_module.c

From: Date: Mon, 26 Aug 2019 14:05:01 +0000
Subject: com php-src: Add ext\opcache stubs: ext/opcache/opcache.stub.php ext/opcache/opcache_arginfo.h ext/opcache/zend_accelera tor_module.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108066@lists.php.net to get a copy of this message
Commit: 0ab4fca8e3f126649901f7a33e3dd8c320d7022e Author: Christoph M. Becker <cmbecker69@gmx.de> Mon, 26 Aug 2019 16:03:24 +0200 Parents: d2210dc2ea69adabbe87a118223970ee2e323e41 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0ab4fca8e3f126649901f7a33e3dd8c320d7022e Log: Add ext\opcache stubs Changed paths: A ext/opcache/opcache.stub.php A ext/opcache/opcache_arginfo.h M ext/opcache/zend_accelerator_module.c Diff: diff --git a/ext/opcache/opcache.stub.php b/ext/opcache/opcache.stub.php new file mode 100644 index 0000000..4dd312a --- /dev/null +++ b/ext/opcache/opcache.stub.php @@ -0,0 +1,15 @@ +<?php + +function opcache_reset(): bool {} + +/** @return array|false */ +function opcache_get_status(bool $fetch_scripts = true) {} + +function opcache_compile_file(string $file): bool {} + +function opcache_invalidate(string $script, bool $force = false): bool {} + +/** @return array|false */ +function opcache_get_configuration() {} + +function opcache_is_script_cached(string $script): bool {} diff --git a/ext/opcache/opcache_arginfo.h b/ext/opcache/opcache_arginfo.h new file mode 100644 index 0000000..7f80ba4 --- /dev/null +++ b/ext/opcache/opcache_arginfo.h @@ -0,0 +1,24 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_reset, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_get_status, 0, 0, 0) + ZEND_ARG_TYPE_INFO(0, fetch_scripts, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_compile_file, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_invalidate, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, script, IS_STRING, 0) + ZEND_ARG_TYPE_INFO(0, force, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_get_configuration, 0, 0, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_opcache_is_script_cached, 0, 1, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, script, IS_STRING, 0) +ZEND_END_ARG_INFO() diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 64784f0..4e8c8c7 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -31,6 +31,7 @@ #include "zend_virtual_cwd.h" #include "ext/standard/info.h" #include "ext/standard/php_filestat.h" +#include "opcache_arginfo..h" #if HAVE_JIT #include "jit/zend_jit.h" @@ -45,26 +46,6 @@ static zif_handler orig_file_exists = NULL; static zif_handler orig_is_file = NULL; static zif_handler orig_is_readable = NULL; -ZEND_BEGIN_ARG_INFO(arginfo_opcache_none, 0) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_get_status, 0, 0, 0) - ZEND_ARG_INFO(0, fetch_scripts) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_compile_file, 0, 0, 1) - ZEND_ARG_INFO(0, file) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_invalidate, 0, 0, 1) - ZEND_ARG_INFO(0, script) - ZEND_ARG_INFO(0, force) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_opcache_is_script_cached, 0, 0, 1) - ZEND_ARG_INFO(0, script) -ZEND_END_ARG_INFO() - /* User functions */ static ZEND_FUNCTION(opcache_reset); static ZEND_FUNCTION(opcache_invalidate); @@ -77,12 +58,12 @@ static ZEND_FUNCTION(opcache_get_configuration); static const zend_function_entry accel_functions[] = { /* User functions */ - ZEND_FE(opcache_reset, arginfo_opcache_none) + ZEND_FE(opcache_reset, arginfo_opcache_reset) ZEND_FE(opcache_invalidate, arginfo_opcache_invalidate) ZEND_FE(opcache_compile_file, arginfo_opcache_compile_file) ZEND_FE(opcache_is_script_cached, arginfo_opcache_is_script_cached) /* Private functions */ - ZEND_FE(opcache_get_configuration, arginfo_opcache_none) + ZEND_FE(opcache_get_configuration, arginfo_opcache_get_configuration) ZEND_FE(opcache_get_status, arginfo_opcache_get_status) ZEND_FE_END };

« previous php.cvs (#108066) next »