summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Duncan <git@duncanc.co.uk>2019-11-17 16:14:09 +0000
committerChristoph M. Becker <cmbecker69@gmx.de>2019-11-18 11:41:24 +0100
commita9e8cd2b6b9e24820643b47f427ee10836d944d6 (patch)
tree0eb7f903526e6151918a2053cf125403c205bc5a
parent7901913b833fc5cceac72711bf235c8a570e8ac1 (diff)
downloadphp-git-a9e8cd2b6b9e24820643b47f427ee10836d944d6.tar.gz
Convert the example skeleton extension to use arginfo stubs
-rwxr-xr-xext/ext_skel.php1
-rw-r--r--ext/skeleton/skeleton.c11
-rw-r--r--ext/skeleton/skeleton.stub5
3 files changed, 7 insertions, 10 deletions
diff --git a/ext/ext_skel.php b/ext/ext_skel.php
index f5cd415ce8..58199f4d8c 100755
--- a/ext/ext_skel.php
+++ b/ext/ext_skel.php
@@ -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'
];
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index 2c03ea9fd5..0bd99f3d41 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -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
index 0000000000..4bddcf37aa
--- /dev/null
+++ b/ext/skeleton/skeleton.stub
@@ -0,0 +1,5 @@
+<?php
+
+function %EXTNAME%_test1(): void {}
+
+function %EXTNAME%_test2(string $str = ""): string {}