PageRenderTime 24ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/ railoapacheportable/php/pear.bat

http://railoapacheportable.googlecode.com/
Batch | 115 lines | 76 code | 12 blank | 27 comment | 1 complexity | 29866ca7a22d389a52e2576c254445fd MD5 | raw file
Possible License(s): BSD-2-Clause, Apache-2.0, EPL-1.0, LGPL-3.0, GPL-3.0, AGPL-1.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, GPL-2.0, LGPL-2.1, BSD-3-Clause, AGPL-3.0, CC-BY-SA-3.0
  1. @ECHO OFF
  2. REM ----------------------------------------------------------------------
  3. REM PHP version 5
  4. REM ----------------------------------------------------------------------
  5. REM Copyright (c) 1997-2004 The PHP Group
  6. REM ----------------------------------------------------------------------
  7. REM This source file is subject to version 3.0 of the PHP license,
  8. REM that is bundled with this package in the file LICENSE, and is
  9. REM available at through the world-wide-web at
  10. REM http://www.php.net/license/3_0.txt.
  11. REM If you did not receive a copy of the PHP license and are unable to
  12. REM obtain it through the world-wide-web, please send a note to
  13. REM license@php.net so we can mail you a copy immediately.
  14. REM ----------------------------------------------------------------------
  15. REM Authors: Alexander Merz (alexmerz@php.net)
  16. REM ----------------------------------------------------------------------
  17. REM
  18. REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary)
  19. REM change this lines to match the paths of your system
  20. REM -------------------
  21. REM Test to see if this is a raw pear.bat (uninstalled version)
  22. SET TMPTMPTMPTMPT=@includ
  23. SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@
  24. FOR %%x IN ("C:\xampp_RailoPortable2\php\PEAR") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED)
  25. REM Check PEAR global ENV, set them if they do not exist
  26. IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=C:\xampp_RailoPortable2\php\PEAR"
  27. IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=C:\xampp_RailoPortable2\php"
  28. IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=C:\xampp_RailoPortable2\php\php.exe"
  29. GOTO :INSTALLED
  30. :NOTINSTALLED
  31. ECHO WARNING: This is a raw, uninstalled pear.bat
  32. REM Check to see if we can grab the directory of this file (Windows NT+)
  33. IF %~n0 == pear (
  34. FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" (
  35. SET "PHP_PEAR_PHP_BIN=%%~$PATH:x"
  36. echo Using PHP Executable "%PHP_PEAR_PHP_BIN%"
  37. "%PHP_PEAR_PHP_BIN%" -v
  38. GOTO :NEXTTEST
  39. ))
  40. GOTO :FAILAUTODETECT
  41. :NEXTTEST
  42. IF "%PHP_PEAR_PHP_BIN%" NEQ "" (
  43. REM We can use this PHP to run a temporary php file to get the dirname of pear
  44. 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
  45. "%PHP_PEAR_PHP_BIN%" ~~getloc.php
  46. set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a
  47. DEL ~a.a
  48. DEL ~~getloc.php
  49. set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear"
  50. REM Make sure there is a pearcmd.php at our disposal
  51. IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php (
  52. IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
  53. IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
  54. IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php
  55. )
  56. )
  57. GOTO :INSTALLED
  58. ) ELSE (
  59. REM Windows Me/98 cannot succeed, so allow the batch to fail
  60. )
  61. :FAILAUTODETECT
  62. echo WARNING: failed to auto-detect pear information
  63. :INSTALLED
  64. REM Check Folders and files
  65. IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
  66. IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
  67. IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
  68. IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
  69. REM launch pearcmd
  70. GOTO RUN
  71. :PEAR_INSTALL_ERROR
  72. ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
  73. ECHO Please fix it using your environment variable or modify
  74. ECHO the default value in pear.bat
  75. ECHO The current value is:
  76. ECHO %PHP_PEAR_INSTALL_DIR%
  77. GOTO END
  78. :PEAR_INSTALL_ERROR2
  79. ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
  80. ECHO pearcmd.php could not be found there.
  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_BIN_ERROR
  87. ECHO PHP_PEAR_BIN_DIR is not set correctly.
  88. ECHO Please fix it using your environment variable or modify
  89. ECHO the default value in pear.bat
  90. ECHO The current value is:
  91. ECHO %PHP_PEAR_BIN_DIR%
  92. GOTO END
  93. :PEAR_PHPBIN_ERROR
  94. ECHO PHP_PEAR_PHP_BIN is not set correctly.
  95. ECHO Please fix it using your environment variable or modify
  96. ECHO the default value in pear.bat
  97. ECHO The current value is:
  98. ECHO %PHP_PEAR_PHP_BIN%
  99. GOTO END
  100. :RUN
  101. "%PHP_PEAR_PHP_BIN%" -C -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
  102. :END
  103. @ECHO ON