summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2003-01-10 01:16:23 +0000
committerStig Bakken <ssb@php.net>2003-01-10 01:16:23 +0000
commit4a723721b9bd0a3766db0d8b7f5e73a828ccd826 (patch)
treec0938e6cf9c178817518f9717315d3d8a8ad1f39
parent4cf28eb0fc1e78b14a4a0e9f68fedd437b5afb18 (diff)
downloadphp-git-4a723721b9bd0a3766db0d8b7f5e73a828ccd826.tar.gz
* obey PHP_PEAR_INSTALL_DIR and PHP_PEAR_PHP_BIN environment variables
-rw-r--r--pear/scripts/pear.in27
1 files changed, 24 insertions, 3 deletions
diff --git a/pear/scripts/pear.in b/pear/scripts/pear.in
index 5677142f4c..cd6736b43c 100644
--- a/pear/scripts/pear.in
+++ b/pear/scripts/pear.in
@@ -1,7 +1,28 @@
#!/bin/sh
-PHP="@php_bin@"
-test "$PHP" = '@'php_bin'@' && PHP=php
-exec $PHP -C -q -d output_buffering=1 $0 $@
+
+# first find which PHP binary to use
+if test "x$PHP_PEAR_PHP_BIN" != "x"; then
+ PHP="$PHP_PEAR_PHP_BIN"
+else
+ if test "@php_bin@" = '@'php_bin'@'; then
+ PHP=php
+ else
+ PHP="@php_bin@"
+ fi
+fi
+
+# then look for the right pear include dir
+if test "x$PHP_PEAR_INSTALL_DIR" != "x"; then
+ INC="-d include_path=$PHP_PEAR_INSTALL_DIR"
+else
+ if test "@php_dir@" = '@'php_dir'@'; then
+ INC=""
+ else
+ INC="-d include_path=@php_dir@"
+ fi
+fi
+
+exec $PHP -C -q $INC -d output_buffering=1 $0 $@
<?php
//
// +----------------------------------------------------------------------+