[Console] Fixed the rendering of exceptions on HHVM with a terminal width
This commit is contained in:
parent
555fde54fa
commit
6e57380d14
@ -728,8 +728,11 @@ class Application
|
|||||||
do {
|
do {
|
||||||
$title = sprintf(' [%s] ', get_class($e));
|
$title = sprintf(' [%s] ', get_class($e));
|
||||||
$len = $strlen($title);
|
$len = $strlen($title);
|
||||||
|
$width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : PHP_INT_MAX;
|
||||||
// HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
|
// HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
|
||||||
$width = $this->getTerminalWidth() ? $this->getTerminalWidth() - 1 : (defined('HHVM_VERSION') ? 1 << 31 : PHP_INT_MAX);
|
if (defined('HHVM_VERSION') && $width > 1 << 31) {
|
||||||
|
$width = 1 << 31;
|
||||||
|
}
|
||||||
$formatter = $output->getFormatter();
|
$formatter = $output->getFormatter();
|
||||||
$lines = array();
|
$lines = array();
|
||||||
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
|
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
|
||||||
|
Reference in New Issue
Block a user