Permalink
Browse files

Write to STDERR instead of php://stderr

Summary:
It doesn't print anything under HPHP.
I've reported it but in the meantime...

Also the semantics of `file_put_contents('php://stderr')` is somewhat weird.
It suggests that the whole error channel is overwritten by the message which is not the case.

Test Plan:
  $ bin/storage --dry-run

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1261

Differential Revision: https://secure.phabricator.com/D3661
  • Loading branch information...
1 parent d711088 commit 7b18e75b006fdebe50c7c7aac02ffd5c5fbaac0a vrana committed Oct 8, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 scripts/daemon/exec/exec_daemon.php
  2. +2 −2 src/parser/argument/PhutilArgumentParser.php
@@ -91,7 +91,7 @@
function phutil_daemon_error_listener($event, $value, array $metadata) {
$message = idx($metadata, 'default_message');
if ($message) {
- file_put_contents('php://stderr', $message);
+ fwrite(STDERR, $message);
}
}
@@ -633,8 +633,8 @@ public function renderWorkflowHelp(
}
public function printUsageException(PhutilArgumentUsageException $ex) {
- file_put_contents(
- 'php://stderr',
+ fwrite(
+ STDERR,
$this->format('**Usage Exception:** '.$ex->getMessage()."\n"));
}

0 comments on commit 7b18e75

Please sign in to comment.