Navigation Menu

Skip to content

Commit

Permalink
Write to STDERR instead of php://stderr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vrana committed Oct 8, 2012
1 parent d0ed67a commit da74127
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions scripts/arcanist.php
Expand Up @@ -522,9 +522,7 @@ function arcanist_load_libraries(
if ($must_load) { if ($must_load) {
throw new ArcanistUsageException($error); throw new ArcanistUsageException($error);
} else { } else {
file_put_contents( fwrite(STDERR, phutil_console_wrap('WARNING: '.$error."\n\n"));
'php://stderr',
phutil_console_wrap('WARNING: '.$error."\n\n"));
} }
} catch (PhutilLibraryConflictException $ex) { } catch (PhutilLibraryConflictException $ex) {
if ($ex->getLibrary() != 'arcanist') { if ($ex->getLibrary() != 'arcanist') {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/ArcanistBaseCommitParser.php
Expand Up @@ -48,7 +48,7 @@ private function tokenizeBaseCommitSpecification($raw_spec) {


private function log($message) { private function log($message) {
if ($this->verbose) { if ($this->verbose) {
file_put_contents('php://stderr', $message."\n"); fwrite(STDERR, $message."\n");
} }
} }


Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistBaseWorkflow.php
Expand Up @@ -1097,7 +1097,7 @@ public function writeLocalArcConfig(array $config) {
* @return void * @return void
*/ */
protected function writeStatusMessage($msg) { protected function writeStatusMessage($msg) {
file_put_contents('php://stderr', $msg); fwrite(STDERR, $msg);
} }


protected function isHistoryImmutable() { protected function isHistoryImmutable() {
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistDiffWorkflow.php
Expand Up @@ -775,7 +775,7 @@ protected function generateChanges() {
if ($is_raw) { if ($is_raw) {


if ($this->getArgument('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'); $raw_diff = file_get_contents('php://stdin');
} else if ($this->getArgument('raw-command')) { } else if ($this->getArgument('raw-command')) {
list($raw_diff) = execx($this->getArgument('raw-command')); list($raw_diff) = execx($this->getArgument('raw-command'));
Expand Down

0 comments on commit da74127

Please sign in to comment.