From da74127fecf21d2b19537d7f637d69464d18cfc8 Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 8 Oct 2012 16:23:49 -0700 Subject: [PATCH] Write to STDERR instead of php://stderr Summary: See D3661. Test Plan: $ arc diff --raw Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1261 Differential Revision: https://secure.phabricator.com/D3662 --- scripts/arcanist.php | 4 +--- src/parser/ArcanistBaseCommitParser.php | 2 +- src/workflow/ArcanistBaseWorkflow.php | 2 +- src/workflow/ArcanistDiffWorkflow.php | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 6669b0b2..36be1053 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -522,9 +522,7 @@ function arcanist_load_libraries( if ($must_load) { throw new ArcanistUsageException($error); } else { - file_put_contents( - 'php://stderr', - phutil_console_wrap('WARNING: '.$error."\n\n")); + fwrite(STDERR, phutil_console_wrap('WARNING: '.$error."\n\n")); } } catch (PhutilLibraryConflictException $ex) { if ($ex->getLibrary() != 'arcanist') { diff --git a/src/parser/ArcanistBaseCommitParser.php b/src/parser/ArcanistBaseCommitParser.php index e226b334..a6a89318 100644 --- a/src/parser/ArcanistBaseCommitParser.php +++ b/src/parser/ArcanistBaseCommitParser.php @@ -48,7 +48,7 @@ final class ArcanistBaseCommitParser { private function log($message) { if ($this->verbose) { - file_put_contents('php://stderr', $message."\n"); + fwrite(STDERR, $message."\n"); } } diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index 15031923..ef21792e 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -1097,7 +1097,7 @@ abstract class ArcanistBaseWorkflow { * @return void */ protected function writeStatusMessage($msg) { - file_put_contents('php://stderr', $msg); + fwrite(STDERR, $msg); } protected function isHistoryImmutable() { diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 1f9fabd9..1eda2118 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -775,7 +775,7 @@ EOTEXT if ($is_raw) { if ($this->getArgument('raw')) { - file_put_contents('php://stderr', "Reading diff from stdin...\n"); + fwrite(STDERR, "Reading diff from stdin...\n"); $raw_diff = file_get_contents('php://stdin'); } else if ($this->getArgument('raw-command')) { list($raw_diff) = execx($this->getArgument('raw-command')); -- 2.43.0