File: php5-module.postinst

package info (click to toggle)
php5 5.2.0%2Bdfsg-8%2Betch16
  • links: PTS
  • area: main
  • in suites: etch
  • size: 58,940 kB
  • ctags: 45,388
  • sloc: ansic: 533,605; sh: 17,835; php: 11,336; cpp: 4,289; xml: 3,809; yacc: 2,446; lex: 2,174; makefile: 1,150; tcl: 1,128; awk: 693; perl: 71; sql: 22; pascal: 15
file content (32 lines) | stat: -rw-r--r-- 826 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e

if [ "$1" != "configure" ]; then
	exit 0
fi

# here we test for upgrades from versions prior to the config-file-scan-dir
# migration.  
#
# to avoid lots of scary warnings about duplicate-loaded modules, each 
# module will remove its "extension=" line from each SAPI's php.ini file
# when upgrading from a "prior version".  this will be the last time we
# ever muck with such files in maintainer scripts.  really.  promise :)

if [ "$2" ] && dpkg --compare-versions "$2" lt "5.1.6-5"; then
	extension_re='^[[:space:]]*extension[[:space:]]*=[[:space:]]*@dsoname@\.so$'
	for SAPI in apache apache2 cgi cli; do
		ini_file="/etc/php5/$SAPI/php.ini"
		if [ -f "$ini_file" ]; then
			if grep -q "$extension_re" $ini_file; then
				sed -i -e "/$extension_re/d" $ini_file
			fi
		fi
	done
fi

#DEBHELPER#

exit 0