dnl PHP_ARG_WITH(toplee, for toplee support, dnl Make sure that the comment is aligned: dnl [ --with-toplee Include toplee support])
dnl Otherwise use enable:
dnl PHP_ARG_ENABLE(toplee, whether to enable toplee support, dnl Make sure that the comment is aligned: dnl [ --enable-toplee Enable toplee support]) 上面的几行意思是说告诉php编译的使用使用那种方式加载我们的扩展模块toplee,我们使用–with-toplee的方式,于是我们修改为下面的样子
PHP_ARG_WITH(toplee, for toplee support, Make sure that the comment is aligned: [ --with-toplee Include toplee support])
dnl Otherwise use enable:
dnl PHP_ARG_ENABLE(toplee, whether to enable toplee support, dnl Make sure that the comment is aligned: dnl [ --enable-toplee Enable toplee support]) 然后我们要做的关键事情就是编写toplee.c,这个是我们编写模块的主要文件,如果您什么都不修改,其实也完成了一个php扩展模块的编写,里面有类似下面的几行代码
len = sprintf(string, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "toplee", arg); RETURN_STRINGL(string, len, 1); } 如果我们在后面完成php的编译时把新的模块编译进去,那么我们就可以在php脚本中调用函数toplee(),它会输出一段字符串 “Congratulations! You have successfully modified ext/toplee/config.m4. Module toplee is now compiled into PHP.”