2014-10-10 38 views
0

我根據composer.json使用Composer在同一目錄中安裝了phpDocumentor 2.*目錄D:\xampp\php\pear\phpDocumentor。 它安裝了phpDocumentor所需的所有依賴項。無法全局使用phpdoc命令

{ 
    "require-dev": { 
     "phpdocumentor/phpdocumentor": "2.*" 
    } 
} 

當我通過Windows命令行導航到該目錄D:\xampp\php\pear\phpDocumentor\vendor\bin和運行phpdoc,它是好的。

Microsoft Windows [Version 6.1.7600] 
Copyright (c) 2009 Microsoft Corporation. All rights reserved. 

C:\Users\TPP>cd\ 

C:\>d: 

D:\>cd xampp\php\pear\phpDocumentor\vendor\bin 

D:\xampp\php\pear\phpDocumentor\vendor\bin>phpdoc --version 
phpDocumentor version 2.7.0 

D:\xampp\php\pear\phpDocumentor\vendor\bin> 

我加入了路徑D:\xampp\php\pear\phpDocumentor\vendor\bin在Windows環境變量,但我無法訪問全球phpdoc

C:\Users\TPP>phpdoc 
****************************************************************************** 
* PhpDocument Command-Line Starter 
* 
* phpDocumentor is a JavaDoc-like automatic documentation generator for PHP 
* written in PHP. It is the most versatile tool for documenting PHP. 
* 
* This batch-file will try to run the phpDocumentor using the command-line 
* version of PHP4. NOTE: It will not run with the PHP ISAPI module! 
* Please update the path in this batch-file to your PHP-CLI. 
* 
* Tip: o Grab a copy of one of the ini-files in the user/ dir of the 
*  phpDocumentor and modify the settings there. 
*  o To see the command line options type phpdoc -h 
* 
* @version 1.3 2003-06-28 
* @author Sam Blum [email protected] 
* @Copyright Free Software released under the GNU/GPL license 
* 
* This SW was contributed by BlueShoes www.blueshoes.org "The PHP Framework" 
****************************************************************************** 
------------------------------------------------------------------------------ 
Select Ini-File [default is phpDocumentor.ini] 
------------------------------------------------------------------------------ 
# 0: phpDocumentor.ini 
Type a number and press Enter[0]:0 
Starting: "D:\xampp\php\.\php.exe" "D:\xampp\php\phpdoc" -c "phpDocumentor.ini" 

Could not open input file: \xampp\php\phpdoc 
Press any key to continue . . . 

C:\Users\TPP> 

它似乎與D:\xampp\php\phpdoc衝突,這可能與PHP安裝。我用PHP 5.4.4使用XAMPP 1.8.0

根據我的新安裝,我怎樣才能使phpdoc在全球範圍內運行?

回答

0

這就是phpDocumentor 1.x包含在XAMPP附帶的其他PEAR包中。最好的選擇是使用XAMPP的PEAR可執行文件卸載phpDocumentor 之前使用Composer安裝phpDocumentor 2.x.任何其他方式來卸載1.x可能會留下一些舊文件。