source: trunk/library/PEAR/scripts/pear.bat @ 5146

Revision 5146, 4.2 KB checked in by wmerlotto, 12 years ago (diff)

Ticket #2305 - Enviando alteracoes, desenvolvidas internamente na Prognus. Library: adicionando arquivos.

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