Skip to content

Commit

Permalink
Add sample upgrade diff
Browse files Browse the repository at this point in the history
  • Loading branch information
reeze committed Jun 7, 2014
1 parent 52a14aa commit 3d5a8ba
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sample/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions sample/lib/sample.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

# sample php lib, you could define fuctions and classes
# please notice the lib WILL not get executed, only functions
# and classes will be imported

# please add our own logic here...

7 changes: 7 additions & 0 deletions sample/sample.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include "config.h"
#endif

#include "php_ext_embed.h"
#include "php_ext_embed_libs.h"

#include <php.h>
#include <ext/standard/info.h>

Expand Down Expand Up @@ -66,18 +69,21 @@ 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;
}

/* {{{ PHP_MINIT_FUNCTION
*/
PHP_MINIT_FUNCTION(sample)
{
PHP_EXT_EMBED_MINIT(sample);
return SUCCESS;
}
/* }}} */
Expand All @@ -86,6 +92,7 @@ PHP_MINIT_FUNCTION(sample)
*/
PHP_MSHUTDOWN_FUNCTION(sample)
{
PHP_EXT_EMBED_MSHUTDOWN(sample);
return SUCCESS;
}
/* }}} */
Expand Down

0 comments on commit 3d5a8ba

Please sign in to comment.