xref: /PHP-5.5/README.EXTENSIONS (revision f496aac1)
1*f496aac1SYasuo OhgakiThis file describes extension module API details. Refer to
2*f496aac1SYasuo OhgakiREADME.EXT_SKEL to create extension skeleton files. Refer to
3*f496aac1SYasuo OhgakiHacker's Guide for PHP internals.
4*f496aac1SYasuo Ohgaki
5*f496aac1SYasuo Ohgakihttp://www.php.net/manual/en/internals2.php
6*f496aac1SYasuo Ohgaki
7*f496aac1SYasuo Ohgaki
8*f496aac1SYasuo Ohgaki
968925208SStig BakkenBetween PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way
1068925208SStig Bakkenthat broke both source and binary compatibility.  If you are
1168925208SStig Bakkenmaintaining a third party extension, here's how to update it:
1268925208SStig Bakken
1368925208SStig BakkenIf this was your old module entry:
1468925208SStig Bakken
1568925208SStig Bakkenzend_module_entry foo_module_entry = {
1668925208SStig Bakken    "foo",                /* extension name */
1768925208SStig Bakken    foo_functions,        /* extension function list */
1868925208SStig Bakken    NULL,                 /* extension-wide startup function */
1968925208SStig Bakken    NULL,                 /* extension-wide shutdown function */
2068925208SStig Bakken    PHP_RINIT(foo),       /* per-request startup function */
2168925208SStig Bakken    PHP_RSHUTDOWN(foo),   /* per-request shutdown function */
2268925208SStig Bakken    PHP_MINFO(foo),       /* information function */
2368925208SStig Bakken    STANDARD_MODULE_PROPERTIES
2468925208SStig Bakken};
2568925208SStig Bakken
2668925208SStig BakkenHere's how it should look if you want your code to build with PHP
2768925208SStig Bakken4.1.0 and up:
2868925208SStig Bakken
2968925208SStig Bakkenzend_module_entry foo_module_entry = {
3068925208SStig Bakken#if ZEND_MODULE_API_NO >= 20010901
3168925208SStig Bakken    STANDARD_MODULE_HEADER,
3268925208SStig Bakken#endif
3368925208SStig Bakken    "foo",                /* extension name */
3468925208SStig Bakken    foo_functions,        /* extension function list */
3568925208SStig Bakken    NULL,                 /* extension-wide startup function */
3668925208SStig Bakken    NULL,                 /* extension-wide shutdown function */
3768925208SStig Bakken    PHP_RINIT(foo),       /* per-request startup function */
3868925208SStig Bakken    PHP_RSHUTDOWN(foo),   /* per-request shutdown function */
3968925208SStig Bakken    PHP_MINFO(foo),       /* information function */
4068925208SStig Bakken#if ZEND_MODULE_API_NO >= 20010901
41b0a36007SAnatol Belski    PHP_FOO_VERSION,      /* extension version number (string) */
4268925208SStig Bakken#endif
4368925208SStig Bakken    STANDARD_MODULE_PROPERTIES
4468925208SStig Bakken};
4568925208SStig Bakken
4668925208SStig BakkenIf you don't care about source compatibility with earlier PHP releases
4768925208SStig Bakkenthan 4.1.0, you can drop the #if/#endif lines.
48