Subversion Repositories Applications.gtt

Rev

Rev 187 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
187 mathias 1
@ECHO OFF
2
 
3
REM ----------------------------------------------------------------------
4
REM PHP version 5
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 ----------------------------------------------------------------------
12
REM
13
REM  Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)
14
 
15
REM change this lines to match the paths of your system
16
REM -------------------
17
 
18
 
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)
23
 
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@"
28
 
29
GOTO :INSTALLED
30
 
31
:NOTINSTALLED
32
ECHO WARNING: This is a raw, uninstalled pear.bat
33
 
34
REM Check to see if we can grab the directory of this file (Windows NT+)
35
IF %~n0 == pear (
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
40
GOTO :NEXTTEST
41
))
42
GOTO :FAILAUTODETECT
43
:NEXTTEST
44
IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
45
 
46
REM We can use this PHP to run a temporary php file to get the dirname of pear
47
 
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
51
DEL ~a.a
52
DEL ~~getloc.php
53
set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
54
 
55
REM Make sure there is a pearcmd.php at our disposal
56
 
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
61
)
62
)
63
GOTO :INSTALLED
64
) ELSE (
65
REM Windows Me/98 cannot succeed, so allow the batch to fail
66
)
67
:FAILAUTODETECT
68
echo WARNING: failed to auto-detect pear information
69
:INSTALLED
70
 
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
76
 
77
REM launch pearcmd
78
GOTO RUN
79
:PEAR_INSTALL_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%
85
GOTO END
86
:PEAR_INSTALL_ERROR2
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%
93
GOTO END
94
:PEAR_BIN_ERROR
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%
100
GOTO END
101
:PEAR_PHPBIN_ERROR
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%
107
GOTO 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