File: php-extensions.sh

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (32 lines) | stat: -rwxr-xr-x 989 bytes parent folder | download | duplicates (7)
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
# File:		php-extensions.sh
# Changes:
#	20010219 Ola Lundqvist <opal@debian.org>
#	20010222 Ola Lundqvist <opal@debian.org>
# Needs:	/usr/share/wwwconfig-common/php.get
#		$extensions - what php extensions to check for!
#		$checkextensions - what php extensions to check for if the
#			corresponding php?-$ext package is installed.	
# Description:	Verifies the php config that the application will use.
#		Ie the higher of php4 and php3.

. /usr/share/wwwconfig-common/php.get

for A in $checkextensions ; do
    if [ -f /var/lib/dpkg/info/php?-$A.list ] ; then
	extensions="$extensions $A"
    fi
done

# Check for php3/4 files
if [ -f $phpini ]; then
    # Make sure all the extensions are being loaded
    for ext in $extensions; do
	if grep -e "^[[:space:]]*extension.*\b$ext\.so" $phpini >/dev/null 2>&1; then
	    log="${log}$ext extension for $phpver found."
	else
	    log="${log}$ext extension for $phpver added!"
	    echo "extension=$ext.so" >>$phpini
	fi
    done
fi