@@ -13,6 +13,8 @@ usage () {
13
13
exit 1
14
14
}
15
15
16
+ mod_name=" $( grep " ^ZEND_GET_MODULE" * .c | grep -Po ' (?<=\()[a-z]+(?=\))' ) "
17
+
16
18
opts=$( getopt -u -o h -l help -- " $@ " )
17
19
[ $? != 0 ] && usage
18
20
@@ -44,7 +46,7 @@ case "${mode}" in
44
46
45
47
rm -f package.xml
46
48
find ./tests ! -name '*.phpt' -a ! -name '*.txt' -a -type f
47
- rm -f magic_arginfo .h && git checkout -- magic_arginfo .h
49
+ rm -f ${mod_name} _arginfo .h && git checkout -- ${mod_name} _arginfo .h
48
50
${normal} ----->
49
51
EOL
50
52
@@ -54,7 +56,7 @@ case "${mode}" in
54
56
rm -f config.h* config.nice configure* config.sub config.guess
55
57
rm -f install-sh ltmain.sh missing mkinstalldirs run-tests.php
56
58
rm -f tests/* .{diff,exp,log,out,php,sh,mem}
57
- rm -f magic_arginfo .h && git checkout -- magic_arginfo .h
59
+ rm -f ${mod_name} _arginfo .h && git checkout -- ${mod_name} _arginfo .h
58
60
;;
59
61
pack)
60
62
cp -af package.xml.tmpl package.xml
@@ -88,9 +90,9 @@ case "${mode}" in
88
90
fi
89
91
90
92
if (( $2 > 71 )) ; then
91
- PHP_OPT+=" -d 'extension_dir=./modules/' -d 'extension=magic .so'"
93
+ PHP_OPT+=" -d 'extension_dir=./modules/' -d 'extension=${mod_name} .so'"
92
94
else
93
- PHP_OPT+=" -d 'track_errors=1' -d 'extension_dir=./modules/' -d 'extension=magic .so'"
95
+ PHP_OPT+=" -d 'track_errors=1' -d 'extension_dir=./modules/' -d 'extension=${mod_name} .so'"
94
96
fi
95
97
96
98
if [[ -f tests/${3} .php ]]; then
@@ -139,7 +141,7 @@ case "${mode}" in
139
141
exit 1
140
142
fi
141
143
phpcmd=" /usr/bin/php80"
142
- perl -pi -e ' s/ext_functions/magic_functions /g' build/gen_stub.php
144
+ perl -pi -e ' s/ext_functions/${mod_name}_functions /g' build/gen_stub.php
143
145
${phpcmd} build/gen_stub.php -f * .stub.php
144
146
;;
145
147
* )
0 commit comments