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