1. Install Pear official website: Http://pear.php.net/PHP 5.4 of Windows package does not come with pear, download Http://pear.php.net/go-pear.phar to PHP directory, and run:
PHP Go-pear.phar
After the installation is complete, a batch file named Pear.bat is generated in the PHP directory, and the following environment variables (user variables, assuming PHP is installed in C:\php) are added to the system:
php_pear_bin_dir=c:\php
Php_pear_data_dir=c:\php\data
Php_pear_doc_dir=c:\php\docs
Php_pear_install_dir=c:\php\pear
Php_pear_php_bin=c:\php\php.exe
php_pear_sysconf_dir=c:\php
Php_pear_test_dir=c:\php\tests
You can take advantage of these environment variables when writing batch scripts that use PHP. At the command line, enter:
Pear version
If there is a display similar to the following information, PEAR has been successfully installed:
PEAR version:1.9.4
PHP version:5.4.4
Zend Engine version:2.4.0
Running on:windows NT acer-tm4750g 5.1 build 2600 (Windows XP Professional Service Pack 3) i586
2. Install PHPUnit official website: Http://www.phpunit.de/PHPUnit 3.6 requires PHP 5.2.7 (or change version) but it is highly recommended to use PHP 5.3.9 (or later). PHPUnit to install using pear:
Pear Config-set Auto_discover 1
Pear Install Pear.phpunit.de/phpunit
After the installation is complete, a batch file named Phpunit.bat is generated in the PHP directory. At the command line, enter:
PHPUnit--version
If there is a display similar to the following information, PHPUnit has been successfully installed:
PHPUnit 3.6.11 by Sebastian Bergmann.
Note that there are also two PHPUnit packages on the official PHP PEAR channel named PHPUnit and PHPUnit2, both of which are old versions, 1.x and 2.x respectively, if you use the following method to install directly:
Pear Install PHPUnit
Then you install the old version PHPUnit 1.x for PHP 4.x, you need to use the Pear.phpunit.de channel to use the latest PHPUnit 3.x version. Using PHPUnit:
%php_pear_bin_dir%\phpunit test.php
3. Install phpdocumentor 2 official website: Http://www.phpdoc.org/phpDocumentor 2 is created for all features of PHP 5.3 or later that generate API documentation. Phpdocumentor 2 is also installed using the pear:
Pear Channel-discover pear.phpdoc.org
Pear Install Phpdoc/phpdocumentor
After the installation is complete, a batch file named Phpdoc.bat is generated in the PHP directory. At the command line, enter:
Phpdoc--version
If there is a display similar to the following information, Phpdocumenter 2 has been successfully installed:
Phpdocumentor version 2.3.1
Using the method, run in the same directory as the project where you want to build the document:
%php_pear_bin_dir%\phpdoc-d. -T Docs