3 REM ----------------------------------------------------------------------
5 REM ----------------------------------------------------------------------
6 REM Copyright (c) 1997-2010 The Authors
7 REM ----------------------------------------------------------------------
8 REM http://opensource.org/licenses/bsd-license.php New BSD License
9 REM ----------------------------------------------------------------------
10 REM Authors: Alexander Merz (alexmerz@php.net)
11 REM ----------------------------------------------------------------------
13 REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)
15 REM change this lines to match the paths of your system
16 REM -------------------
19 REM Test to see if this is a raw pear.bat (uninstalled version)
20 SET TMPTMPTMPTMPT=@includ
21 SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
22 FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
24 REM Check PEAR global ENV, set them if they do not exist
25 IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
26 IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
27 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
32 ECHO WARNING: This is a raw, uninstalled pear.bat
34 REM Check to see if we can grab the directory of this file (Windows NT+)
36 FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
37 SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
38 echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
39 "%PHP_PEAR_PHP_BIN%" -v
44 IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
46 REM We can use this PHP to run a temporary php file to get the dirname of pear
48 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
49 "%PHP_PEAR_PHP_BIN%" ~~getloc.php
50 set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
53 set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
55 REM Make sure there is a pearcmd.php at our disposal
57 IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
58 IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
59 IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
60 IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
65 REM Windows Me/98 cannot succeed, so allow the batch to fail
68 echo WARNING: failed to auto-detect pear information
71 REM Check Folders and files
72 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
73 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
74 IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
75 IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
80 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
81 ECHO Please fix it using your environment variable or modify
82 ECHO the default value in pear.bat
83 ECHO The current value is:
84 ECHO %PHP_PEAR_INSTALL_DIR%
87 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
88 ECHO pearcmd.php could not be found there.
89 ECHO Please fix it using your environment variable or modify
90 ECHO the default value in pear.bat
91 ECHO The current value is:
92 ECHO %PHP_PEAR_INSTALL_DIR%
95 ECHO PHP_PEAR_BIN_DIR is not set correctly.
96 ECHO Please fix it using your environment variable or modify
97 ECHO the default value in pear.bat
98 ECHO The current value is:
99 ECHO %PHP_PEAR_BIN_DIR%
102 ECHO PHP_PEAR_PHP_BIN is not set correctly.
103 ECHO Please fix it using your environment variable or modify
104 ECHO the default value in pear.bat
105 ECHO The current value is:
106 ECHO %PHP_PEAR_PHP_BIN%
109 "%PHP_PEAR_PHP_BIN%" -C -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9