1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#!/bin/sh -e
PECL_NAME=##peclpackagename##
PHP_VERSION=##phpversion##
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$DPKG_DEBUG" = "developer" ]; then
set -x
fi
if [ "$1" != "configure" ]; then
exit 0
fi
##DEBHELPER##
for SAPI in apache2 apache cgi cli; do
if [ -f /etc/php${PHP_VERSION}/$SAPI/php.ini ]; then
db_get php${PHP_VERSION}/extension_${PECL_NAME}_$SAPI
if [ "$RET" = "true" ] \
&& ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*${PECL_NAME}\.so" /etc/php${PHP_VERSION}/$SAPI/php.ini
then
echo "extension=${PECL_NAME}.so" >> /etc/php${PHP_VERSION}/$SAPI/php.ini
fi
fi
done
exit 0
# Restart apache(s) so settings get refreshed
if [ -d /etc/php${PHP_VERSION}/apache2 ]; then
for srv in apache2 ; do
if [ -x "/etc/init.d/$srv" ]; then
if [ -x /usr/sbin/invoke-rc.d ]; then
/usr/sbin/invoke-rc.d $srv force-reload
else
/etc/init.d/$srv force-reload
fi
fi
done
fi
if [ -d /etc/php${PHP_VERSION}/apache ]; then
for srv in apache apache-ssl apache-perl ; do
if [ -x "/etc/init.d/$srv" ]; then
if [ -x /usr/sbin/invoke-rc.d ]; then
/usr/sbin/invoke-rc.d $srv force-reload
else
/etc/init.d/$srv force-reload
fi
fi
done
fi
exit 0
|