diff --git a/pipi-php/config.m4 b/pipi-php/config.m4 index edd5a14..39b7d2a 100644 --- a/pipi-php/config.m4 +++ b/pipi-php/config.m4 @@ -2,12 +2,11 @@ PHP_ARG_ENABLE(pipi, whether to enable Libpipi support, [ --enable-pipi Enable Libpipi support]) if test "$PHP_PIPI" = "yes"; then - PHP_NEW_EXTENSION(pipi, php_pipi.c, $ext_shared) - PHP_SUBST(PIPI_SHARED_LIBADD) - AC_DEFINE(HAVE_PIPI, 1, [Whether you have Libpipi Ext]) - PIPI_INCDIR=$PHP_PIPI/include - PIPI_LIBDIR=$PHP_PIPI/lib - PHP_ADD_LIBRARY_WITH_PATH(pipi, $PIPI_LIBDIR, PIPI_SHARED_LIBADD) - PHP_ADD_INCLUDE($PIPI_INCDIR) -fi - + AC_CHECK_LIB(pipi, pipi_get_version, [ + PHP_ADD_LIBRARY(pipi,, PIPI_SHARED_LIBADD) + ], [ + AC_MSG_ERROR(libpipi required !) + ]) + PHP_NEW_EXTENSION(pipi, php_pipi.c, $ext_shared,,) + PHP_SUBST(PIPI_SHARED_LIBADD) +fi diff --git a/pipi-php/examples/example1.php b/pipi-php/examples/example1.php index 2c2f152..e525311 100644 --- a/pipi-php/examples/example1.php +++ b/pipi-php/examples/example1.php @@ -1,7 +1,4 @@ - 0.1 + 0.0 2008-10-15 - GPL + WTFPL alpha - See included ChangeLog for details... + See included ChangeLog for details... - + - - - - diff --git a/pipi-php/php_pipi.c b/pipi-php/php_pipi.c index 0bad38a..553dfbd 100644 --- a/pipi-php/php_pipi.c +++ b/pipi-php/php_pipi.c @@ -124,7 +124,7 @@ PHP_MINFO_FUNCTION(pipi) { } -//--------PIPI'S RESSOURCES---------// +//--------PIPI'S RESSOURCES DESTRUCTORS---------// static void php_pipi_image_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pipi_free(rsrc->ptr); @@ -138,6 +138,9 @@ static void php_pipi_histogram_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { pipi_free_histogram(rsrc->ptr); } + +//--------INITIALIZATION---------// + PHP_MINIT_FUNCTION(pipi) { le_pipi_image = zend_register_list_destructors_ex(php_pipi_image_dtor, NULL, PHP_PIPI_IMAGE_RES_NAME, module_number); le_pipi_context = zend_register_list_destructors_ex(php_pipi_context_dtor, NULL, PHP_PIPI_CONTEXT_RES_NAME, module_number);