This repository has been archived by the owner on Jan 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
phpdoc.bat
80 lines (61 loc) · 1.99 KB
/
phpdoc.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@ECHO OFF
REM Author : AVONTURE Christophe
setlocal enabledelayedexpansion enableextensions
REM Define global variables
SET PROGNAME=PHPDOC
SET GITHUB=https://github.com/phpDocumentor/phpDocumentor2
SET SCRIPT=%APPDATA%\Composer\vendor\bin\phpDocumentor.phar
SET BATCH=%~n0%~x0
CLS
ECHO ========================================================
ECHO = %PROGNAME% - Documentation Generator for PHP =
ECHO = @see %GITHUB% =
ECHO ========================================================
ECHO.
IF "%1"=="/?" GOTO :HELP
if "%1"=="-?" GOTO :HELP
if "%1"=="-h" GOTO :HELP
IF NOT EXIST %SCRIPT% (
GOTO NOTINSTALLED:
)
REM For phpdoc, check if we've a file phpdoc.xml in the current
REM working directory i.e. the one of the project.
REM If so, use that configuration file.
REM If not, use the phpdoc.xml present in the folder of the phpdoc.bat
REM script
SET configFile=%cd%\phpdoc.xml
IF NOT EXIST %configFile% (
SET configFile=%ScriptFolder%phpdoc.xml
)
REM ECHO Command line options are
ECHO --config=%configFile%
ECHO --progressbar (show progress)
ECHO -t docs (target folder will be 'docs')
ECHO.
php %SCRIPT% run --config=%configFile% --progressbar -t docs
START chrome.exe %cd%\docs\index.html
GOTO:EOF
::--------------------------------------------------------
::-- Not installed
::--------------------------------------------------------
:NOTINSTALLED
ECHO %PROGNAME% (%GITHUB%) is not installed
ECHO on your machine. Since phpDocumentor2 should be installed manually, please do:
ECHO.
ECHO 1. Go to %GITHUB%/releases and take the latest release
ECHO 2. Download both the `phpDocumentor.phar` and `phpDocumentor.phar.pubkey` files
ECHO 3. Go to your `%APPDATA%\Composer\Vendor\Bin\` folder and save the two files there
ECHO.
GOTO END:
::--------------------------------------------------------
::-- Show help instructions
::--------------------------------------------------------
:HELP
ECHO %BATCH% [-h] [foldername]
ECHO.
ECHO -h : to get this screen
ECHO.
GOTO END:
:END
ECHO.
ECHO End