home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / phpdoc.bat < prev    next >
DOS Batch File  |  2008-07-02  |  5KB  |  146 lines

  1. @ECHO OFF
  2. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3. ::
  4. :: Batch file to start phpDocumentor with PHP's CLI
  5. ::
  6. :: This SW was contributed by BlueShoes www.blueshoes.org "The PHP Framework"
  7. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  8.  
  9. ::----------------------------------------------------------------------------------
  10. :: Please set following to PHP's CLI
  11. :: NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe. 
  12. ::       PHP 4.3.x names it php.exe but stores it in a subdir called /cli/php.exe
  13. ::       E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
  14. ::            for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
  15.   
  16.   SET phpCli=\xampp\php\.\php.exe
  17.  
  18.  
  19.  
  20. ::---------------------------------------------------------------------------------
  21. ::---------------------------------------------------------------------------------
  22. :: Do not modify below this line!! (Unless you know what your doing :)
  23. ::---------------------------------------------------------------------------------
  24. ::---------------------------------------------------------------------------------
  25.  
  26. :: Only show this intro when no options are passed
  27. IF '%1'=='' (
  28.   ECHO ******************************************************************************
  29.   ECHO * PhpDocument Command-Line  Starter 
  30.   ECHO * 
  31.   ECHO * phpDocumentor is a JavaDoc-like automatic documentation generator for PHP
  32.   ECHO * written in PHP. It is the most versatile tool for documenting PHP.
  33.   ECHO *
  34.   ECHO * This batch-file will try to run the phpDocumentor using the command-line
  35.   ECHO * version of PHP4. NOTE: It will not run with the PHP ISAPI module! 
  36.   ECHO * Please update the path in this batch-file to your PHP-CLI.
  37.   ECHO *
  38.   ECHO * Tip: o Grab a copy of one of the ini-files in the user/ dir of the 
  39.   ECHO *        phpDocumentor and modify the settings there. 
  40.   ECHO *      o To see the command line options type  phpdoc -h
  41.   ECHO * 
  42.   ECHO * @version 1.3  2003-06-28
  43.   ECHO * @author Sam Blum sam@blueshoes.org
  44.   ECHO * @Copyright Free Software released under the GNU/GPL license
  45.   ECHO * 
  46.   ECHO * This SW was contributed by BlueShoes www.blueshoes.org "The PHP Framework"
  47.   ECHO ******************************************************************************
  48. )
  49.  
  50. :: Check existence of php.exe
  51. IF EXIST "%phpCli%" (
  52.   SET doNothing=
  53. ) ELSE GOTO :NoPhpCli
  54.  
  55. :: If called using options, just call phpdoc and end after without pausing.
  56. :: This will allow use where pausing is not wanted.
  57. IF '%1'=='' (
  58.   SET doNothing=
  59. ) ELSE (
  60.   "%phpCli%" -d include_path="\xampp\php\pear" "\xampp\php\phpdoc" %*
  61.   GOTO :EOF
  62. )
  63.  
  64.  
  65. SET iniFile=
  66.  
  67. ECHO ------------------------------------------------------------------------------
  68. ECHO Select Ini-File [default is phpDocumentor.ini]
  69. ECHO ------------------------------------------------------------------------------
  70. ECHO # 0: phpDocumentor.ini
  71. SET count=0
  72. FOR /R "C:\php5\pear\data\PhpDocumentor\user" %%I IN (*.ini) DO (
  73.   SET /a count+=1
  74.   CALL :exec ECHO # %%count%%: %%~nI%%~xI
  75. )
  76.  
  77. :LOOP_1
  78. :: SET /P prompts for input and sets the variable
  79. :: to whatever the user types
  80. SET iniNr=
  81. SET /P iniNr=Type a number and press Enter[0]:
  82.  
  83. ::  Use default
  84. IF '%iniNr%'=='' (
  85.   SET iniNr=0
  86. )
  87.  
  88. :: Check for default selection
  89. SET iniFile=phpDocumentor.ini
  90. IF %iniNr%==0 (
  91.   CALL :exec GOTO :run
  92.   GOTO :PAUSE_END
  93. )
  94.  
  95. :: Check selected
  96. SET count=0
  97. SET found=
  98. FOR /R "C:\php5\pear\data\PhpDocumentor\user" %%I IN (*.ini) DO (
  99.   SET /a count+=1
  100.   SET iniFile=%%~nI%%~xI
  101.   CALL :exec IF '%%iniNr%%'=='%%count%%' GOTO :run 
  102. )
  103.  
  104. :: Check if selected # was found
  105. IF '%found%'=='' (
  106.   ECHO Invalid input [%iniNr%]... try again
  107.   ECHO.
  108.   GOTO :LOOP_1
  109. )
  110.  
  111. ::
  112. :: php.exe not found error  
  113. GOTO :PAUSE_END
  114. :NoPhpCli
  115. ECHO ** ERROR *****************************************************************
  116. ECHO * Sorry, can't find the php.exe file.
  117. ECHO * You must edit this file to point to your php.exe (CLI version!)
  118. ECHO *    [Currently set to %phpCli%]
  119. ECHO * 
  120. ECHO * NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe. 
  121. ECHO *       PHP 4.3.x renamed it php.exe but stores it in a subdir 
  122. ECHO *       called /cli/php.exe
  123. ECHO *       E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
  124. ECHO *            for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
  125. ECHO **************************************************************************
  126.  
  127. ::
  128. :: Stupid MS-batch: Can't evaluate environment variable inside a FOR loop!!! :((  
  129. GOTO :PAUSE_END
  130. :exec 
  131. %*
  132. GOTO :EOF
  133.  
  134. ::
  135. :: Start the phpDocumentor 
  136. GOTO :PAUSE_END
  137. :run
  138. SET found=1
  139. ECHO Starting: "%phpCli%" "\xampp\php\phpdoc" -c "%iniFile%"
  140. ECHO.
  141. "%phpCli%"  -d include_path="\xampp\php\pear" "\xampp\php\phpdoc" -c "%iniFile%"
  142. GOTO :EOF
  143.  
  144. :PAUSE_END
  145. PAUSE
  146.