Skip to content

Commit 297caeb

Browse files
committed
* use PHP_PEAR_* environment variables (paj)
1 parent 7d4142b commit 297caeb

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

pear/scripts/pear.bat

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,54 @@ REM ----------------------------------------------------------------------
1616
REM Authors: Alexander Merz (alexmerz@php.net)
1717
REM ----------------------------------------------------------------------
1818
REM
19-
REM $Id: pear.bat,v 1.12 2003/01/03 00:17:41 phanto Exp $
19+
REM $Id: pear.bat,v 1.13 2003/03/25 14:34:02 mj Exp $
2020

2121
REM change this lines to match the paths of your system
2222
REM -------------------
2323

24-
set PHP_BIN=@php_bin@
25-
set BIN_DIR=@bin_dir@
26-
set PEAR_PATH=@include_path@
27-
28-
%PHP_BIN% -C -d output_buffering=1 -d include_path=%PEAR_PATH% -f %BIN_DIR%\pear -- %1 %2 %3 %4 %5 %6 %7 %8 %9
24+
@ECHO OFF
25+
:: Check PEAR global ENV, set them if they do not exist
26+
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET PHP_PEAR_INSTALL_DIR=@include_path@
27+
IF "%PHP_PEAR_BIN_DIR%"=="" SET PHP_PEAR_BIN_DIR=@bin_dir@
28+
IF "%PHP_PEAR_PHP_BIN%"=="" SET PHP_PEAR_PHP_BIN=@php_bin@
29+
30+
:: Check Folders and files
31+
IF NOT EXIST %PHP_PEAR_INSTALL_DIR% GOTO PEAR_INSTALL_ERROR
32+
IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php GOTO PEAR_INSTALL_ERROR2
33+
IF NOT EXIST %PHP_PEAR_BIN_DIR% GOTO PEAR_BIN_ERROR
34+
IF NOT EXIST %PHP_PEAR_PHP_BIN% GOTO PEAR_PHPBIN_ERROR
35+
:: launch pearcmd
36+
GOTO RUN
37+
:PEAR_INSTALL_ERROR
38+
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
39+
ECHO Please fix it using your environment variable or modify
40+
ECHO the default value in pear.bat
41+
ECHO The current value is:
42+
ECHO %PHP_PEAR_INSTALL_DIR%
43+
GOTO END
44+
:PEAR_INSTALL_ERROR2
45+
ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
46+
ECHO pearcmd.php could not be found there.
47+
ECHO Please fix it using your environment variable or modify
48+
ECHO the default value in pear.bat
49+
ECHO The current value is:
50+
ECHO %PHP_PEAR_INSTALL_DIR%
51+
GOTO END
52+
:PEAR_BIN_ERROR
53+
ECHO PHP_PEAR_BIN_DIR is not set correctly.
54+
ECHO Please fix it using your environment variable or modify
55+
ECHO the default value in pear.bat
56+
ECHO The current value is:
57+
ECHO %PHP_PEAR_BIN_DIR%
58+
GOTO END
59+
:PEAR_PHPBIN_ERROR
60+
ECHO PHP_PEAR_PHP_BIN is not set correctly.
61+
ECHO Please fix it using your environment variable or modify
62+
ECHO the default value in pear.bat
63+
ECHO The current value is:
64+
ECHO %PHP_PEAR_PHP_BIN%
65+
GOTO END
66+
:RUN
67+
%PHP_PEAR_PHP_BIN% -C -d output_buffering=1 -d include_path=%PHP_PEAR_INSTALL_DIR% -f %PHP_PEAR_INSTALL_DIR%\pearcmd.php -- %1 %2 %3 %4 %5 %6 %7 %8 %9
68+
:END
2969
@ECHO ON

0 commit comments

Comments
 (0)