Skip to content

Commit

Permalink
Create output directory when it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot authored and sebastianbergmann committed Dec 31, 2010
1 parent 97a5734 commit d184a77
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PHP/CodeCoverage/Report/Clover.php
Expand Up @@ -455,6 +455,11 @@ public function process(PHP_CodeCoverage $coverage, $target = NULL, $name = NULL
$project->appendChild($metrics);

if ($target !== NULL) {
if (!is_dir(dirname($target)))
{
mkdir(dirname($target), 0, true);
}

return $document->save($target);
} else {
return $document->saveXML();
Expand Down

0 comments on commit d184a77

Please sign in to comment.