Created
September 6, 2013 12:39
-
-
Save paul-court/6463200 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
<?php | |
/** | |
* Sets the stdout and stderr streams if they are not already set. | |
*/ | |
private static function initializeOutputStreams() { | |
if (self::$out === null) { | |
if (!defined('STDOUT')) { | |
self::$out = new OutputStream(fopen('php://stdout', 'w')); | |
} else { | |
self::$out = new OutputStream(STDOUT); | |
} | |
} | |
if (self::$err === null) { | |
if (!defined('STDERR')) { | |
self::$out = new OutputStream(fopen('php://stderr', 'w')); | |
} else { | |
self::$err = new OutputStream(STDERR); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment