Skip to content

Commit 3ead672

Browse files
rhabackerpetk
authored andcommitted
Fix #77609: Tests from mailparse extension fails
Add installed php extensions to temporary created ini file In php extensions configured with phpize, a temporarily generated php.ini is used for testing, but currently contains no installed PHP extensions, which is required by the mailparse extension, for example. Installed extensions must be added with their absolute path, because the extension_dir parameter is already occupied. See https://bugs.php.net/bug.php?id=77609
1 parent 5025eb0 commit 3ead672

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Makefile.global

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,21 @@ PHP_TEST_SHARED_EXTENSIONS = ` \
8383
. $$i; $(top_srcdir)/build/shtool echo -n -- " -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname"; \
8484
done; \
8585
fi`
86-
PHP_DEPRECATED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\t\ ]*='
86+
PHP_FILTERED_DIRECTIVES_REGEX = '^(magic_quotes_(gpc|runtime|sybase)?|zend_extension(_debug)?(_ts)?)[\t\ ]*='
87+
PHP_EXTENSION_PATH_FIX_REGEX = "/^extension *= *[^/]/s,extension *= *,extension=$(EXTENSION_DIR)/,g"
8788

8889
test: all
8990
@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
9091
INI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \
9192
if test "$$INI_FILE"; then \
92-
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_FILE" > $(top_builddir)/tmp-php.ini; \
93+
$(EGREP) -h -v $(PHP_FILTERED_DIRECTIVES_REGEX) "$$INI_FILE" | $(SED) $(PHP_EXTENSION_PATH_FIX_REGEX) > $(top_builddir)/tmp-php.ini; \
9394
else \
9495
echo > $(top_builddir)/tmp-php.ini; \
9596
fi; \
9697
INI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(",\n", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \
9798
if test "$$INI_SCANNED_PATH"; then \
9899
INI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \
99-
$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini >> $(top_builddir)/tmp-php.ini; \
100+
$(EGREP) -h -v $(PHP_FILTERED_DIRECTIVES_REGEX) "$$INI_SCANNED_PATH"/*.ini | $(SED) $(PHP_EXTENSION_PATH_FIX_REGEX) >> $(top_builddir)/tmp-php.ini; \
100101
fi; \
101102
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
102103
TEST_PHP_SRCDIR=$(top_srcdir) \

0 commit comments

Comments
 (0)