在我的 Windows 7 系统上,我在 wamp 中设置了 phpDocumentor (版本 2.6.1),我的路径如下:
D:\Projects\wamp\www\phpDocumentor
D:\Projects\wamp\www\phpDocumentor\bin
现在我所做的是我编辑了phpdoc.bat
位于路径的文件:
D:\Projects\wamp\www\phpDocumentor\bin\phpdoc.bat
它包含如下所示的代码:
@echo off
if "%PHPBIN%" == "" set PHPBIN=php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "D:\Projects\wamp\www\phpDocumentor\bin\phpdoc" %*
"%PHPBIN%" "%PHP_PEAR_BIN_DIR%\phpdoc" %*
所以,我用新代码编辑了最后一行"%PHPBIN%" "phpdoc" %*
。之后phpdoc.bat
看起来像:
@echo off
if "%PHPBIN%" == "" set PHPBIN=php.exe
if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
"%PHPBIN%" "phpdoc" %*
此后,我再次运行以下命令cmd
:
D:\Projects\wamp\www\phpDocumentor\bin>phpdoc
输出是这样的:
D:\Projects\wamp\www\phpDocumentor\bin>phpdoc
Collecting files .. OK
Initializing parser .. OK
Parsing files
[Exception]
No parsable files were found, did you specify any using the -f or -d parame
ter?
project:run [-t|--target[="..."]] [-f|--filename[="..."]] [-d|--directory[="..."
]] [--encoding[="..."]] [-e|--extensions[="..."]] [-i|--ignore[="..."]] [--ignor
e-tags[="..."]] [--hidden] [--ignore-symlinks] [-m|--markers[="..."]] [--title[=
"..."]] [--force] [--validate] [--visibility[="..."]] [--defaultpackagename[="..
."]] [--sourcecode] [-p|--progressbar] [--template[="..."]] [--parseprivate] [--
log[="..."]]
D:\Projects\wamp\www\phpDocumentor\bin>
所以,输出表明它成功了!