Updated PEAR and PEAR packages.
[timetracker.git] / WEB-INF / lib / pear / scripts / pear.bat
1 @ECHO OFF\r
2 \r
3 REM ----------------------------------------------------------------------\r
4 REM PHP version 5\r
5 REM ----------------------------------------------------------------------\r
6 REM Copyright (c) 1997-2010 The Authors\r
7 REM ----------------------------------------------------------------------\r
8 REM http://opensource.org/licenses/bsd-license.php New BSD License\r
9 REM ----------------------------------------------------------------------\r
10 REM  Authors:     Alexander Merz (alexmerz@php.net)\r
11 REM ----------------------------------------------------------------------\r
12 REM\r
13 REM  Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)\r
14 \r
15 REM change this lines to match the paths of your system\r
16 REM -------------------\r
17 \r
18 \r
19 REM Test to see if this is a raw pear.bat (uninstalled version)\r
20 SET TMPTMPTMPTMPT=@includ\r
21 SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@\r
22 FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)\r
23 \r
24 REM Check PEAR global ENV, set them if they do not exist\r
25 IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"\r
26 IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"\r
27 IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"\r
28 \r
29 GOTO :INSTALLED\r
30 \r
31 :NOTINSTALLED\r
32 ECHO WARNING: This is a raw, uninstalled pear.bat\r
33 \r
34 REM Check to see if we can grab the directory of this file (Windows NT+)\r
35 IF %~n0 == pear (\r
36 FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (\r
37 SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"\r
38 echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"\r
39 "%PHP_PEAR_PHP_BIN%" -v\r
40 GOTO :NEXTTEST\r
41 ))\r
42 GOTO :FAILAUTODETECT\r
43 :NEXTTEST\r
44 IF "%PHP_PEAR_PHP_BIN%" NEQ "" (\r
45 \r
46 REM We can use this PHP to run a temporary php file to get the dirname of pear\r
47 \r
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\r
49 "%PHP_PEAR_PHP_BIN%" ~~getloc.php\r
50 set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a\r
51 DEL ~a.a\r
52 DEL ~~getloc.php\r
53 set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"\r
54 \r
55 REM Make sure there is a pearcmd.php at our disposal\r
56 \r
57 IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (\r
58 IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php\r
59 IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php\r
60 IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php\r
61 )\r
62 )\r
63 GOTO :INSTALLED\r
64 ) ELSE (\r
65 REM Windows Me/98 cannot succeed, so allow the batch to fail\r
66 )\r
67 :FAILAUTODETECT\r
68 echo WARNING: failed to auto-detect pear information\r
69 :INSTALLED\r
70 \r
71 REM Check Folders and files\r
72 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR\r
73 IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2\r
74 IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR\r
75 IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR\r
76 \r
77 REM launch pearcmd\r
78 GOTO RUN\r
79 :PEAR_INSTALL_ERROR\r
80 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.\r
81 ECHO Please fix it using your environment variable or modify\r
82 ECHO the default value in pear.bat\r
83 ECHO The current value is:\r
84 ECHO %PHP_PEAR_INSTALL_DIR%\r
85 GOTO END\r
86 :PEAR_INSTALL_ERROR2\r
87 ECHO PHP_PEAR_INSTALL_DIR is not set correctly.\r
88 ECHO pearcmd.php could not be found there.\r
89 ECHO Please fix it using your environment variable or modify\r
90 ECHO the default value in pear.bat\r
91 ECHO The current value is:\r
92 ECHO %PHP_PEAR_INSTALL_DIR%\r
93 GOTO END\r
94 :PEAR_BIN_ERROR\r
95 ECHO PHP_PEAR_BIN_DIR is not set correctly.\r
96 ECHO Please fix it using your environment variable or modify\r
97 ECHO the default value in pear.bat\r
98 ECHO The current value is:\r
99 ECHO %PHP_PEAR_BIN_DIR%\r
100 GOTO END\r
101 :PEAR_PHPBIN_ERROR\r
102 ECHO PHP_PEAR_PHP_BIN is not set correctly.\r
103 ECHO Please fix it using your environment variable or modify\r
104 ECHO the default value in pear.bat\r
105 ECHO The current value is:\r
106 ECHO %PHP_PEAR_PHP_BIN%\r
107 GOTO END\r
108 :RUN\r
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\r
110 :END\r
111 @ECHO ON