--extname=module module is the name of your extension --proto=file file contains prototypes of functions to create --stubs=file generate only function stubs in file --xml generate xml documentation to be added to phpdoc-cvs --skel=dir path to the skeleton directory --full-xml generate xml documentation for a self-contained extension (not yet implemented) --no-help don't try to be nice and create comments in the code and helper functions to test if the module compiled
dnl PHP_ARG_ENABLE(dump, whether to enable dump support, dnl Make sure that the comment is aligned: dnl [ --enable-dumpEnabledump support])
第四步、添加函数声明
在php_dump.h的47行:
1
PHP_FUNCTION(confirm_dump_compiled); /* For testing, remove later. */
添加一行我们自己的函数声明:
1
PHP_FUNCTION(dump);
第五步、实现相应功能
在dump.c的41行:
1 2 3 4
const zend_function_entry dump_functions[] = { PHP_FE(confirm_dump_compiled, NULL) /* For testing, remove later. */ PHP_FE_END /* Must be the last line in dump_functions[] */ };
中添加一行,使其变为:
1 2 3 4 5
const zend_function_entry dump_functions[] = { PHP_FE(confirm_dump_compiled, NULL) /* For testing, remove later. */ PHP_FE(dump, NULL) PHP_FE_END /* Must be the last line in dump_functions[] */ };