]> granicus.if.org Git - php/commitdiff
Convert the example skeleton extension to use arginfo stubs
authorCraig Duncan <git@duncanc.co.uk>
Sun, 17 Nov 2019 16:14:09 +0000 (16:14 +0000)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 18 Nov 2019 10:41:24 +0000 (11:41 +0100)
ext/ext_skel.php
ext/skeleton/skeleton.c
ext/skeleton/skeleton.stub [new file with mode: 0644]

index f5cd415ce8e5f8ec293539047a76d748e56f3465..58199f4d8cb8192c4232471587793bcfb86f8d99 100755 (executable)
@@ -330,6 +330,7 @@ function copy_sources() {
 
        $files = [
                        'skeleton.c'            => $options['ext'] . '.c',
+                       'skeleton.stub'         => $options['ext'] . '.stub.php',
                        'php_skeleton.h'        => 'php_' . $options['ext'] . '.h'
                        ];
 
index 2c03ea9fd5ae697fc238bd17ffb40a3958902909..0bd99f3d41cd81bf779a190fae17388644b54fd2 100644 (file)
@@ -7,6 +7,7 @@
 #include "php.h"
 #include "ext/standard/info.h"
 #include "php_%EXTNAME%.h"
+#include "%EXTNAME%_arginfo.h"
 
 /* For compatibility with older PHP versions */
 #ifndef ZEND_PARSE_PARAMETERS_NONE
@@ -66,16 +67,6 @@ PHP_MINFO_FUNCTION(%EXTNAME%)
 }
 /* }}} */
 
-/* {{{ arginfo
- */
-ZEND_BEGIN_ARG_INFO(arginfo_%EXTNAME%_test1, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_%EXTNAME%_test2, 0)
-       ZEND_ARG_INFO(0, str)
-ZEND_END_ARG_INFO()
-/* }}} */
-
 /* {{{ %EXTNAME%_functions[]
  */
 static const zend_function_entry %EXTNAME%_functions[] = {
diff --git a/ext/skeleton/skeleton.stub b/ext/skeleton/skeleton.stub
new file mode 100644 (file)
index 0000000..4bddcf3
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+function %EXTNAME%_test1(): void {}
+
+function %EXTNAME%_test2(string $str = ""): string {}