]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Write to STDERR instead of php://stderr
authorvrana <jakubv@fb.com>
Mon, 8 Oct 2012 23:23:49 +0000 (16:23 -0700)
committervrana <jakubv@fb.com>
Mon, 8 Oct 2012 23:34:18 +0000 (16:34 -0700)
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
src/parser/ArcanistBaseCommitParser.php
src/workflow/ArcanistBaseWorkflow.php
src/workflow/ArcanistDiffWorkflow.php

index 6669b0b29e62bda6ea058a6491f1b012d936806e..36be10531a49c8c341f0732abfe1114d2e3ff3ab 100755 (executable)
@@ -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') {
index e226b3340de79f11d88c39887e34f03378d3f724..a6a893183dfa2cc2536e96da77bd29906c84fee9 100644 (file)
@@ -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");
     }
   }
 
index 15031923cc5e5c7d15ade818f46b6ea94a4ec808..ef21792e52d9458f350e3ca21407e618101e399b 100644 (file)
@@ -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() {
index 1f9fabd9a577d459cb8c312826cd3182a658c80d..1eda21187973541c3eec6315b90bac6c3f1a90ec 100644 (file)
@@ -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'));