]> git.pld-linux.org Git - packages/php.git/blob - dep-tests.sh
This commit was manufactured by cvs2git to create branch 'DEVEL'.
[packages/php.git] / dep-tests.sh
1 #!/bin/sh
2 # inter-dependencies checker.
3
4 with_mysqlnd=mysqlnd
5
6 dep_spl="pcre simplexml"
7 dep_session="spl $dep_spl"
8 dep_filter='pcre'
9 dep_eaccelerator='session'
10 dep_mysql="$with_mysqlnd"
11 dep_mysqli="$dep_spl spl $with_mysqlnd"
12 dep_pdo="$dep_spl spl"
13 dep_pdo_sqlite="$dep_pdo pdo"
14 dep_pdo_pgsql="$dep_pdo pdo"
15 dep_pdo_oci="$dep_pdo pdo"
16 dep_pdo_odbc="$dep_pdo pdo"
17 dep_pdo_firebird="$dep_pdo pdo"
18 dep_pdo_dblib="$dep_pdo pdo"
19 dep_pdo_mysql="$dep_pdo pdo $with_mysqlnd"
20 dep_simplexml="$dep_spl spl"
21 dep_imap="pcre"
22 dep_phar="$dep_spl spl"
23 dep_sqlite="$dep_pdo pdo"
24 dep_fileinfo="pcre"
25 dep_wddx='xml'
26 dep_xmlreader='dom'
27 dep_xmlrpc='xml'
28 dep_xsl='dom'
29
30 php=${PHP:-$(php-config --php-binary)}
31 ext_dir=${EXTENSION_DIR:-$(php-config --extension-dir)}
32 conf_dir=${CONFIG_DIR:-$(php-config --sysconfdir)/conf.d $(php-config --sysconfdir)/cli.d}
33 tmpini=$(mktemp)
34
35 # poldek --sn ac-ready -u php-*
36 for ext in $ext_dir/*.so; do
37         [ -f $ext ] || continue
38         ext=${ext##*/}; ext=${ext%.so}
39
40         deps=$(eval echo \$dep_$ext)
41         # add ext itself, if already not in list (spl case)
42         [[ $deps = *\ $ext\ * ]] || deps="$deps $ext"
43
44         echo -n "$ext (deps: ${deps# })..."
45
46         grep -rlE '^extension=('$(echo "${deps# }" | tr ' ' '|')').so$' $conf_dir | LC_CTYPE=C LC_ALL= sort | xargs cat > $tmpini
47         $php -n -d extension_dir=$ext_dir -c $tmpini -r "exit(extension_loaded('${ext}') ? 0 : 1);"
48         rc=$?
49         if [ $rc = 0 ]; then
50                 echo OK
51         else
52                 echo FAIL
53                 echo "Failed config was:"
54                 cat $tmpini
55         fi
56 done
57 rm -f $t
This page took 0.030844 seconds and 3 git commands to generate.