3 REM ----------------------------------------------------------------------
\r
5 REM ----------------------------------------------------------------------
\r
6 REM Copyright (c) 1997-2004 The PHP Group
\r
7 REM ----------------------------------------------------------------------
\r
8 REM This source file is subject to version 3.0 of the PHP license,
\r
9 REM that is bundled with this package in the file LICENSE, and is
\r
10 REM available at through the world-wide-web at
\r
11 REM http://www.php.net/license/3_0.txt.
\r
12 REM If you did not receive a copy of the PHP license and are unable to
\r
13 REM obtain it through the world-wide-web, please send a note to
\r
14 REM license@php.net so we can mail you a copy immediately.
\r
15 REM ----------------------------------------------------------------------
\r
16 REM Authors: Alexander Merz (alexmerz@php.net)
\r
17 REM ----------------------------------------------------------------------
\r
19 REM Last updated 02/08/2004 ($Id$ is not replaced if the file is binary)
\r
21 REM change this lines to match the paths of your system
\r
22 REM -------------------
\r
25 REM Test to see if this is a raw pear.bat (uninstalled version)
\r
26 SET TMPTMPTMPTMPT=@includ
\r
27 SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
\r
28 FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
\r
30 REM Check PEAR global ENV, set them if they do not exist
\r
31 IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
\r
32 IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
\r
33 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
\r
37 ECHO WARNING: This is a raw, uninstalled pear.bat
\r
39 REM Check to see if we can grab the directory of this file (Windows NT+)
\r
41 FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
\r
42 SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
\r
43 echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
\r
44 "%PHP_PEAR_PHP_BIN%" -v
\r
47 GOTO :FAILAUTODETECT
\r
49 IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
\r
51 REM We can use this PHP to run a temporary php file to get the dirname of pear
\r
53 echo ^<?php $s=getcwd^(^);chdir^($a=dirname^(__FILE__^).'\\'^);if^(stristr^($a,'\\scripts'^)^)$a=dirname^(dirname^($a^)^).'\\';$f=fopen^($s.'\\~a.a','wb'^);echo$s.'\\~a.a';fwrite^($f,$a^);fclose^($f^);chdir^($s^);?^> > ~~getloc.php
\r
54 "%PHP_PEAR_PHP_BIN%" ~~getloc.php
\r
55 set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
\r
58 set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
\r
60 REM Make sure there is a pearcmd.php at our disposal
\r
62 IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
\r
63 IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
\r
64 IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
\r
65 IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
\r
70 REM Windows Me/98 cannot succeed, so allow the batch to fail
\r
73 echo WARNING: failed to auto-detect pear information
\r
76 REM Check Folders and files
\r
77 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
\r
78 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
\r
79 IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
\r
80 IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
\r
84 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
\r
85 ECHO Please fix it using your environment variable or modify
\r
86 ECHO the default value in pear.bat
\r
87 ECHO The current value is:
\r
88 ECHO %PHP_PEAR_INSTALL_DIR%
\r
90 :PEAR_INSTALL_ERROR2
\r
91 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
\r
92 ECHO pearcmd.php could not be found there.
\r
93 ECHO Please fix it using your environment variable or modify
\r
94 ECHO the default value in pear.bat
\r
95 ECHO The current value is:
\r
96 ECHO %PHP_PEAR_INSTALL_DIR%
\r
99 ECHO PHP_PEAR_BIN_DIR is not set correctly.
\r
100 ECHO Please fix it using your environment variable or modify
\r
101 ECHO the default value in pear.bat
\r
102 ECHO The current value is:
\r
103 ECHO %PHP_PEAR_BIN_DIR%
\r
106 ECHO PHP_PEAR_PHP_BIN is not set correctly.
\r
107 ECHO Please fix it using your environment variable or modify
\r
108 ECHO the default value in pear.bat
\r
109 ECHO The current value is:
\r
110 ECHO %PHP_PEAR_PHP_BIN%
\r
113 "%PHP_PEAR_PHP_BIN%" -C -n -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -d register_argc_argv="On" -d variables_order=EGPCS -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
\r