Permalink
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
View
@@ -3,38 +3,31 @@ PHP_CodeCoverage
**PHP_CodeCoverage** is a library that provides collection, processing, and rendering functionality for PHP code coverage information.
-Installation
+Requirements
------------
-PHP_CodeCoverage should be installed using the [PEAR Installer](http://pear.php.net/). 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](http://xdebug.org/) 2.0.5 (or later) is required but Xdebug 2.1.2 (or later) is highly recommended.
-The PEAR channel (`pear.phpunit.de`) 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 (`components.ez.no`).
+Installation
+------------
- sb@ubuntu ~ % pear channel-discover pear.phpunit.de
- Adding Channel "pear.phpunit.de" succeeded
- Discovery of channel "pear.phpunit.de" succeeded
+PHP_CodeCoverage should be installed using the PEAR Installer, the backbone of the [PHP Extension and Application Repository](http://pear.php.net/) that provides a distribution system for PHP packages.
- sb@ubuntu ~ % pear channel-discover components.ez.no
- Adding Channel "components.ez.no" succeeded
- Discovery of channel "components.ez.no" 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 ](http://pear.php.net/manual/en/installation.getting.php) 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.phpunit.de/PHP_CodeCoverage-0.9.0
+ pear config-set auto_discover 1
+ pear install pear.phpunit.de/PHP_CodeCoverage
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
------------------------------
<?php
- 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.