File: php5-cli.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 (37 lines) | stat: -rw-r--r-- 1,008 bytes parent folder | download | duplicates (3)
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
#!/bin/sh

set -e

#DEBHELPER#

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

phpini="/etc/php5/cli/php.ini"
# LEGACY SUPPORT
# previous versions of php did not ship $phpini as a conffile nor did
# they use anything like ucf.  as a result, we need to help transition
# those files into ucf a little more easily by updating unmodified
# ini files before registering them
#
# if we're upgrading from a pre-ucf version of php:
if dpkg --compare-versions "$2" le-nl "5.1.6-4"; then
	# if the SAPI config file already exists and is unmodified
	if [ -f "$phpini" ]; then
		oldmd5=`md5sum $phpini | cut -d' ' -f1`
		if [ "$oldmd5" = "c85605baab79fbcd3c289e442eb3caa2" ]; then
			# then silently update it before registering via ucf
			cp /usr/share/php5/php.ini-dist.cli $phpini
		fi
	fi
fi
# END LEGACY SUPPORT

ucf /usr/share/php5/php.ini-dist.cli $phpini

update-alternatives \
	--install /usr/bin/php php /usr/bin/php5 50 \
	--slave /usr/share/man/man1/php.1.gz php.1.gz /usr/share/man/man1/php5.1.gz

exit 0