Permalink
Browse files

Allow streams as logging targets.

  • Loading branch information...
1 parent bda58e6 commit b2efc2a7425847d4b0e3043985c0344415dbd110 @sebastianbergmann committed Oct 4, 2011
Showing with 9 additions and 7 deletions.
  1. +9 −7 PHPUnit/Util/Configuration.php
View
16 PHPUnit/Util/Configuration.php
@@ -377,12 +377,9 @@ public function getLoggingConfiguration()
foreach ($this->xpath->query('logging/log') as $log) {
$type = (string)$log->getAttribute('type');
- if ($type == 'coverage-text' &&
- $log->getAttribute('target') == 'php://stdout') {
- $target = 'php://stdout';
- } else {
- $target = $this->toAbsolutePath((string)$log->getAttribute('target'));
- }
+ $target = $this->toAbsolutePath(
+ (string)$log->getAttribute('target')
+ );
if ($type == 'coverage-html') {
if ($log->hasAttribute('title')) {
@@ -932,13 +929,18 @@ protected function readFilterFiles($query)
*/
protected function toAbsolutePath($path, $useIncludePath = FALSE)
{
- // is the path already an absolute path?
+ // Check whether the path is already absolute.
if ($path[0] === '/' || $path[0] === '\\' ||
(strlen($path) > 3 && ctype_alpha($path[0]) &&
$path[1] === ':' && ($path[2] === '\\' || $path[2] === '/'))) {
return $path;
}
+ // Check whether a stream is used.
+ if (strpos($path, '://') !== FALSE) {
+ return $path;
+ }
+
$file = dirname($this->filename) . DIRECTORY_SEPARATOR . $path;
if ($useIncludePath && !file_exists($file)) {

0 comments on commit b2efc2a

Please sign in to comment.