From 3c14dba94e837322e030b19b41654952624cb485 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 26 Sep 2017 16:55:42 +0200 Subject: Implement, test and document namespace support --- src/config.m4 | 3 ++- src/tests/config/config_disabled_functions_namespace.ini | 2 +- src/tests/disabled_functions_namespace.phpt | 14 ++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/config.m4 b/src/config.m4 index bf5523a..04eefa2 100644 --- a/src/config.m4 +++ b/src/config.m4 @@ -26,13 +26,14 @@ LDFLAGS="$LDFLAGS -lpcre" if test "$PHP_DEBUG" = "yes"; then AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages]) + CFLAGS="$CFLAGS -g -ggdb -O0" fi AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE(HAVE_PCRE, 1, [have pcre])) if test "$PHP_SNUFFLEUPAGUS" = "yes"; then if test "$PHP_COVERAGE" = "yes"; then - CFLAGS="$CFLAGS -g --coverage -lgcov -O1 -g" + CFLAGS="$CFLAGS --coverage -lgcov -O1 -g" fi PHP_NEW_EXTENSION(snuffleupagus, $sources, $ext_shared,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) fi diff --git a/src/tests/config/config_disabled_functions_namespace.ini b/src/tests/config/config_disabled_functions_namespace.ini index d09b81b..78c7f92 100644 --- a/src/tests/config/config_disabled_functions_namespace.ini +++ b/src/tests/config/config_disabled_functions_namespace.ini @@ -1,2 +1,2 @@ sp.disable_functions.function("strcmp").drop(); -sp.disable_functions.function("my_super_namespace::my_function").drop(); +sp.disable_functions.function("my_super_namespace\\my_function").drop(); diff --git a/src/tests/disabled_functions_namespace.phpt b/src/tests/disabled_functions_namespace.phpt index 72c7d0b..8934337 100644 --- a/src/tests/disabled_functions_namespace.phpt +++ b/src/tests/disabled_functions_namespace.phpt @@ -1,5 +1,5 @@ --TEST-- -Disable functions: namespaces support isn't implemented now +Disable functions in namespaces --SKIPIF-- --INI-- @@ -8,17 +8,17 @@ sp.configuration_file={PWD}/config/config_disabled_functions_namespace.ini ---XFAIL-- --EXPECTF-- -[snuffleupagus] The call to the function 'strcmp' in %a/tests/disabled_functions_namespace.php:%d has been disabled. +[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'strcmp' in %a/disabled_functions_namespace.php:%d has been disabled. +[snuffleupagus][0.0.0.0][disabled_function][drop] The call to the function 'my_super_namespace\my_function' in %a/disabled_functions_namespace.php:%d has been disabled. +Second namespace +Anonymous namespace -- cgit v1.3