Skip to content

Commit f7e204d

Browse files
committed
Slightly modernize ext_skel and sekelton/
- .svnignore ->.gitignore - Add .gitignore entries for DSO stand-alone builds stuff - Docs don't use CVS but SVN - reorder extname.c file so it needs less forward declarations - take forward declarations out of php_extname.h - Drop #if for 12 years old PHP version compatibility
1 parent a5d177c commit f7e204d

File tree

3 files changed

+91
-73
lines changed

3 files changed

+91
-73
lines changed

‎ext/ext_skel

+35-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo ""
1212
echo " --extname=module module is the name of your extension"
1313
echo " --proto=file file contains prototypes of functions to create"
1414
echo " --stubs=file generate only function stubs in file"
15-
echo " --xml generate xml documentation to be added to phpdoc-cvs"
15+
echo " --xml generate xml documentation to be added to phpdoc-svn"
1616
echo " --skel=dir path to the skeleton directory"
1717
echo " --full-xml generate xml documentation for a self-contained extension"
1818
echo " (not yet implemented)"
@@ -187,11 +187,43 @@ if (PHP_$EXTNAME != "no") {
187187
188188
eof
189189

190-
$ECHO_N " .svnignore$ECHO_C"
191-
cat >.svnignore <<eof
190+
$ECHO_N " .gitignore$ECHO_C"
191+
cat >.gitignore <<eof
192192
.deps
193193
*.lo
194194
*.la
195+
.libs
196+
acinclude.m4
197+
aclocal.m4
198+
autom4te.cache
199+
build
200+
config.guess
201+
config.h
202+
config.h.in
203+
config.log
204+
config.nice
205+
config.status
206+
config.sub
207+
configure
208+
configure.in
209+
include
210+
install-sh
211+
libtool
212+
ltmain.sh
213+
Makefile
214+
Makefile.fragments
215+
Makefile.global
216+
Makefile.objects
217+
missing
218+
mkinstalldirs
219+
modules
220+
run-tests.php
221+
tests/*/*.diff
222+
tests/*/*.out
223+
tests/*/*.php
224+
tests/*/*.exp
225+
tests/*/*.log
226+
tests/*/*.sh
195227
eof
196228

197229
$ECHO_N " $extname.c$ECHO_C"

‎ext/skeleton/php_skeleton.h

-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ extern zend_module_entry extname_module_entry;
1818
#include "TSRM.h"
1919
#endif
2020

21-
PHP_MINIT_FUNCTION(extname);
22-
PHP_MSHUTDOWN_FUNCTION(extname);
23-
PHP_RINIT_FUNCTION(extname);
24-
PHP_RSHUTDOWN_FUNCTION(extname);
25-
PHP_MINFO_FUNCTION(extname);
26-
27-
PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */
28-
/* __function_declarations_here__ */
29-
3021
/*
3122
Declare any global variables you may need between the BEGIN
3223
and END macros here:

‎ext/skeleton/skeleton.c

+56-61
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,6 @@ ZEND_DECLARE_MODULE_GLOBALS(extname)
1616
/* True global resources - no need for thread safety here */
1717
static int le_extname;
1818

19-
/* {{{ extname_functions[]
20-
*
21-
* Every user visible function must have an entry in extname_functions[].
22-
*/
23-
const zend_function_entry extname_functions[] = {
24-
PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */
25-
/* __function_entries_here__ */
26-
PHP_FE_END /* Must be the last line in extname_functions[] */
27-
};
28-
/* }}} */
29-
30-
/* {{{ extname_module_entry
31-
*/
32-
zend_module_entry extname_module_entry = {
33-
#if ZEND_MODULE_API_NO >= 20010901
34-
STANDARD_MODULE_HEADER,
35-
#endif
36-
"extname",
37-
extname_functions,
38-
PHP_MINIT(extname),
39-
PHP_MSHUTDOWN(extname),
40-
PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */
41-
PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */
42-
PHP_MINFO(extname),
43-
#if ZEND_MODULE_API_NO >= 20010901
44-
"0.1", /* Replace with version number for your extension */
45-
#endif
46-
STANDARD_MODULE_PROPERTIES
47-
};
48-
/* }}} */
49-
50-
#ifdef COMPILE_DL_EXTNAME
51-
ZEND_GET_MODULE(extname)
52-
#endif
53-
5419
/* {{{ PHP_INI
5520
*/
5621
/* Remove comments and fill if you need to have entries in php.ini
@@ -61,6 +26,35 @@ PHP_INI_END()
6126
*/
6227
/* }}} */
6328

29+
/* Remove the following function when you have successfully modified config.m4
30+
so that your module can be compiled into PHP, it exists only for testing
31+
purposes. */
32+
33+
/* Every user-visible function in PHP should document itself in the source */
34+
/* {{{ proto string confirm_extname_compiled(string arg)
35+
Return a string to confirm that the module is compiled in */
36+
PHP_FUNCTION(confirm_extname_compiled)
37+
{
38+
char *arg = NULL;
39+
int arg_len, len;
40+
char *strg;
41+
42+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
43+
return;
44+
}
45+
46+
len = spprintf(&strg, 0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg);
47+
RETURN_STRINGL(strg, len, 0);
48+
}
49+
/* }}} */
50+
/* The previous line is meant for vim and emacs, so it can correctly fold and
51+
unfold functions in source code. See the corresponding marks just before
52+
function definition, where the functions purpose is also documented. Please
53+
follow this convention for the convenience of others editing your code.
54+
*/
55+
56+
/* __function_stubs_here__ */
57+
6458
/* {{{ php_extname_init_globals
6559
*/
6660
/* Uncomment this function if you have INI entries
@@ -126,35 +120,36 @@ PHP_MINFO_FUNCTION(extname)
126120
}
127121
/* }}} */
128122

123+
/* {{{ extname_functions[]
124+
*
125+
* Every user visible function must have an entry in extname_functions[].
126+
*/
127+
const zend_function_entry extname_functions[] = {
128+
PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */
129+
/* __function_entries_here__ */
130+
PHP_FE_END /* Must be the last line in extname_functions[] */
131+
};
132+
/* }}} */
129133

130-
/* Remove the following function when you have successfully modified config.m4
131-
so that your module can be compiled into PHP, it exists only for testing
132-
purposes. */
133-
134-
/* Every user-visible function in PHP should document itself in the source */
135-
/* {{{ proto string confirm_extname_compiled(string arg)
136-
Return a string to confirm that the module is compiled in */
137-
PHP_FUNCTION(confirm_extname_compiled)
138-
{
139-
char *arg = NULL;
140-
int arg_len, len;
141-
char *strg;
142-
143-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
144-
return;
145-
}
146-
147-
len = spprintf(&strg, 0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg);
148-
RETURN_STRINGL(strg, len, 0);
149-
}
134+
/* {{{ extname_module_entry
135+
*/
136+
zend_module_entry extname_module_entry = {
137+
STANDARD_MODULE_HEADER,
138+
"extname",
139+
extname_functions,
140+
PHP_MINIT(extname),
141+
PHP_MSHUTDOWN(extname),
142+
PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */
143+
PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */
144+
PHP_MINFO(extname),
145+
"0.1", /* Replace with version number for your extension */
146+
STANDARD_MODULE_PROPERTIES
147+
};
150148
/* }}} */
151-
/* The previous line is meant for vim and emacs, so it can correctly fold and
152-
unfold functions in source code. See the corresponding marks just before
153-
function definition, where the functions purpose is also documented. Please
154-
follow this convention for the convenience of others editing your code.
155-
*/
156149

157-
/* __function_stubs_here__ */
150+
#ifdef COMPILE_DL_EXTNAME
151+
ZEND_GET_MODULE(extname)
152+
#endif
158153

159154
/*
160155
* Local variables:

0 commit comments

Comments
 (0)