]> granicus.if.org Git - php/commitdiff
Add ext\opcache stubs
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 26 Aug 2019 14:03:24 +0000 (16:03 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 26 Aug 2019 14:05:01 +0000 (16:05 +0200)
ext/opcache/opcache.stub.php [new file with mode: 0644]
ext/opcache/opcache_arginfo.h [new file with mode: 0644]
ext/opcache/zend_accelerator_module.c

diff --git a/ext/opcache/opcache.stub.php b/ext/opcache/opcache.stub.php
new file mode 100644 (file)
index 0000000..4dd312a
--- /dev/null
@@ -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 (file)
index 0000000..7f80ba4
--- /dev/null
@@ -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()
index 64784f020b9ade84f76541960bda5af24a6dd8d9..4e8c8c7f5bcb335a19bef52b9bef1067786f6548 100644 (file)
@@ -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
 };