From 3d5a8bab58ffe2d10c465ba4a671e1b89be3b2f3 Mon Sep 17 00:00:00 2001 From: Reeze Xia Date: Sat, 7 Jun 2014 11:03:04 +0800 Subject: [PATCH] Add sample upgrade diff --- sample/config.m4 | 8 +++++++- sample/lib/sample.inc.php | 8 ++++++++ sample/sample.c | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 sample/lib/sample.inc.php diff --git a/sample/config.m4 b/sample/config.m4 index 69d6ece..eca2810 100644 --- a/sample/config.m4 +++ b/sample/config.m4 @@ -7,5 +7,11 @@ PHP_ARG_WITH(sample, for sample support, if test "$PHP_SAMPLE" != "no"; then PHP_SUBST(SAMPLE_SHARED_LIBADD) - PHP_NEW_EXTENSION(sample, [sample.c], $ext_shared) + m4_include(php-ext-embed/php_ext_embed.m4) + PHP_EXT_EMBED_INIT(sample) + + dnl you could update it for your own need + PHP_EXT_EMBED_ADD_INCLUDE_LIB(sample, [lib/*.php]) + + PHP_EXT_EMBED_NEW_EXTENSION(sample, [sample.c], $ext_shared) fi diff --git a/sample/lib/sample.inc.php b/sample/lib/sample.inc.php new file mode 100644 index 0000000..05e1958 --- /dev/null +++ b/sample/lib/sample.inc.php @@ -0,0 +1,8 @@ + #include @@ -66,11 +69,13 @@ ZEND_GET_MODULE(sample) PHP_RINIT_FUNCTION(sample) { + PHP_EXT_EMBED_RINIT(sample); return SUCCESS; } PHP_RSHUTDOWN_FUNCTION(sample) { + PHP_EXT_EMBED_RSHUTDOWN(sample); return SUCCESS; } @@ -78,6 +83,7 @@ PHP_RSHUTDOWN_FUNCTION(sample) */ PHP_MINIT_FUNCTION(sample) { + PHP_EXT_EMBED_MINIT(sample); return SUCCESS; } /* }}} */ @@ -86,6 +92,7 @@ PHP_MINIT_FUNCTION(sample) */ PHP_MSHUTDOWN_FUNCTION(sample) { + PHP_EXT_EMBED_MSHUTDOWN(sample); return SUCCESS; } /* }}} */