Browse files

Update instructions.

  • Loading branch information...
1 parent ba27330 commit 742d1af801c16d724dcef16dd198883d2125cad2 @sebastianbergmann sebastianbergmann committed Sep 9, 2011
Showing with 11 additions and 18 deletions.
  1. +11 −18 README.markdown
@@ -3,38 +3,31 @@ PHP_CodeCoverage
**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information.
-PHP_CodeCoverage should be installed using the [PEAR Installer]( This installer is the backbone of PEAR, which provides a distribution system for PHP packages, and is shipped with every release of PHP since version 4.3.0.
+* PHP 5.2.7 (or later) is required but PHP 5.3.8 (or later) is highly recommended.
+* [Xdebug]( 2.0.5 (or later) is required but Xdebug 2.1.2 (or later) is highly recommended.
-The PEAR channel (``) that is used to distribute PHP_CodeCoverage needs to be registered with the local PEAR environment. Furthermore, a component that PHP_CodeCoverage depends upon is hosted on the eZ Components PEAR channel (``).
- sb@ubuntu ~ % pear channel-discover
- Adding Channel "" succeeded
- Discovery of channel "" succeeded
+PHP_CodeCoverage should be installed using the PEAR Installer, the backbone of the [PHP Extension and Application Repository]( that provides a distribution system for PHP packages.
- sb@ubuntu ~ % pear channel-discover
- Adding Channel "" succeeded
- Discovery of channel "" succeeded
+Depending on your OS distribution and/or your PHP environment, you may need to install PEAR or update your existing PEAR installation before you can proceed with the instructions in this chapter. `sudo pear upgrade PEAR` usually suffices to upgrade an existing PEAR installation. The [PEAR Manual ]( explains how to perform a fresh installation of PEAR.
-This has to be done only once. Now the PEAR Installer can be used to install packages from the PHPUnit channel:
+The following two commands are all that is required to install PHP_CodeCoverage using the PEAR Installer:
- sb@vmware ~ % pear install phpunit/PHP_CodeCoverage
- downloading PHP_CodeCoverage-0.9.0.tgz ...
- Starting to download PHP_CodeCoverage-0.9.0.tgz (108,376 bytes)
- .........................done: 108,376 bytes
- install ok: channel://
+ pear config-set auto_discover 1
+ pear install
After the installation you can find the PHP_CodeCoverage source files inside your local PEAR directory; the path is usually `/usr/lib/php/PHP/CodeCoverage`.
Using the PHP_CodeCoverage API
- require_once 'PHP/CodeCoverage.php';
- require_once 'PHP/CodeCoverage/Report/Clover.php';
- require_once 'PHP/CodeCoverage/Report/HTML.php';
+ require 'PHP/CodeCoverage/Autoload.php';
$coverage = new PHP_CodeCoverage;
$coverage->start('<name of test>');

0 comments on commit 742d1af

Please sign in to comment.