com php-src: Convert the example skeleton extension to use arginfo stubs: ext/ext_skel.php ext/skeleton/skeleton.c ext/skeleton /skeleton.stub
| From: | Christoph Michael Becker | Date: | Mon, 18 Nov 2019 10:41:24 +0000 |
| Subject: | com php-src: Convert the example skeleton extension to use arginfo stubs: ext/ext_skel.php ext/skeleton/skeleton.c ext/skeleton /skeleton.stub | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109282@lists.php.net to get a copy of this message | ||
Commit: a9e8cd2b6b9e24820643b47f427ee10836d944d6
Author: Craig Duncan <git@duncanc.co.uk> Sun, 17 Nov 2019 16:14:09 +0000
Committer: Christoph M. Becker <cmbecker69@gmx.de> Mon, 18 Nov 2019 11:41:24 +0100
Parents: 7901913b833fc5cceac72711bf235c8a570e8ac1
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a9e8cd2b6b9e24820643b47f427ee10836d944d6
Log:
Convert the example skeleton extension to use arginfo stubs
Changed paths:
M ext/ext_skel.php
M ext/skeleton/skeleton.c
A ext/skeleton/skeleton.stub
Diff:
diff --git a/ext/ext_skel.php b/ext/ext_skel.php
index f5cd415ce8e..58199f4d8cb 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 2c03ea9fd5a...0bd99f3d41c 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 00000000000..4bddcf37aa5
--- /dev/null
+++ b/ext/skeleton/skeleton.stub
@@ -0,0 +1,5 @@
+<?php
+
+function %EXTNAME%_test1(): void {}
+
+function %EXTNAME%_test2(string $str = ""): string {}