Page MenuHomePhabricator

Disable ANSI output if STDOUT is undefined
ClosedPublic

Authored by joshuaspence on Feb 11 2015, 7:27 AM.
Tags
None
Referenced Files
F15424307: D11739.diff
Sat, Mar 22, 9:22 PM
F15424192: D11739.id28285.diff
Sat, Mar 22, 8:46 PM
F15419719: D11739.id28348.diff
Fri, Mar 21, 8:21 AM
F15418601: D11739.id28348.diff
Fri, Mar 21, 12:22 AM
F15410138: D11739.diff
Wed, Mar 19, 6:49 AM
F15405096: D11739.id.diff
Tue, Mar 18, 10:15 AM
F15399416: D11739.diff
Mon, Mar 17, 4:25 AM
F15378949: D11739.diff
Thu, Mar 13, 5:48 PM
Subscribers

Details

Summary

Currently, I am hitting the following exception when attempting to use an out-of-date XHPAST binary:

[2015-02-11 18:02:10] EXCEPTION: (RuntimeException) Use of undefined constant STDOUT - assumed 'STDOUT' at [<phutil>/src/error/PhutilErrorHandler.php:221]
  #0 PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phutil>/src/console/PhutilConsoleFormatter.php:33]
  #1 PhutilConsoleFormatter::getDisableANSI() called at [<phutil>/src/console/PhutilConsoleFormatter.php:51]
  #2 PhutilConsoleFormatter::formatString(string, string, string)
  #3 call_user_func_array(array, array) called at [<phutil>/src/console/format.php:7]
  #4 phutil_console_format(string, string, string) called at [<phutil>/src/parser/xhpast/bin/PhutilXHPASTBinary.php:68]
  #5 PhutilXHPASTBinary::getBuildInstructions() called at [<phutil>/src/parser/xhpast/bin/PhutilXHPASTBinary.php:84]
  #6 PhutilXHPASTBinary::getParserFuture(string) called at [<phabricator>/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php:14]
  #7 PhabricatorXHPASTViewRunController::processRequest() called at [<phabricator>/src/aphront/AphrontController.php:33]
  #8 AphrontController::handleRequest(AphrontRequest) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:196]
  #9 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:121]
  #10 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:19]

The simple fix is to disable ANSI output when STDOUT is undefined.

Test Plan

Attempted to use XHPAST and hit the correct (PhutilXHPASTBinary::getBuildInstructions()) exception.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Disable ANSI output if STDOUT is undefined.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
joshuaspence edited edge metadata.
joshuaspence updated this object.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Feb 12 2015, 6:07 PM
This revision was automatically updated to reflect the committed changes.