Created
December 20, 2012 11:54
-
-
Save twogood/4344878 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
# .... | |
php_value auto_prepend_file /etc/apache2/local/coverage-start.php | |
php_value auto_append_file /etc/apache2/local/coverage-stop.php | |
# .... | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_GET['coverage'])) { | |
setcookie('coverage', $_GET['coverage']); | |
} | |
if ((isset($_GET['coverage']) && $_GET['coverage'] == '1') | |
|| (isset($_COOKIE['coverage']) && $_COOKIE['coverage'] == '1')){ | |
require 'PHP/CodeCoverage/Autoload.php'; | |
$_____coverage = new PHP_CodeCoverage; | |
$_____coverage->start('apache'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_____coverage)){ | |
$_____coverage->stop(); | |
$writer = new PHP_CodeCoverage_Report_PHP; | |
$COVERAGE_DIRECTORY = '/tmp/coverage'; | |
if (!file_exists($COVERAGE_DIRECTORY)){ | |
mkdir($COVERAGE_DIRECTORY); | |
} | |
$writer->process($_____coverage, tempnam($COVERAGE_DIRECTORY, 'coverage')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cd /tmp/coverage chown -R a+r . for f in *; do mv
basename $f .cov$f.cov; done phpcov --html /tmp/cov-html/ --merge