From: ZoDream <648383079@qq.com> Date: Mon, 23 Mar 2020 01:45:34 +0000 (+0800) Subject: Repair ext_skel.php to create the basic framework for a PHP extension X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28afaef6faf587bd379b8114c4ed2cb93984f579;p=php Repair ext_skel.php to create the basic framework for a PHP extension Copy the arginfo stubs file, and drop the %EXTNAME%_ to make things line up. Closes GH-5289. --- diff --git a/ext/ext_skel.php b/ext/ext_skel.php index 5c6835940f..e456714882 100755 --- a/ext/ext_skel.php +++ b/ext/ext_skel.php @@ -331,7 +331,8 @@ function copy_sources() { $files = [ 'skeleton.c' => $options['ext'] . '.c', 'skeleton.stub.php' => $options['ext'] . '.stub.php', - 'php_skeleton.h' => 'php_' . $options['ext'] . '.h' + 'php_skeleton.h' => 'php_' . $options['ext'] . '.h', + 'skeleton_arginfo.h' => $options['ext'] . '_arginfo.h' ]; foreach ($files as $src_file => $dst_file) { diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c index eae396156f..61e9365ea1 100644 --- a/ext/skeleton/skeleton.c +++ b/ext/skeleton/skeleton.c @@ -26,9 +26,9 @@ PHP_FUNCTION(test1) } /* }}} */ -/* {{{ string %EXTNAME%_test2( [ string $var ] ) +/* {{{ string test2( [ string $var ] ) */ -PHP_FUNCTION(%EXTNAME%_test2) +PHP_FUNCTION(test2) { char *var = "World"; size_t var_len = sizeof("World") - 1;