/** * Constructor * @param int $memoryUsage memory used * @param int $memoryPeakUsage memory peak * @param int $padPositionX x position of the pad in the main screen * @param int $padPositionY y position of the pad in the main screen */ public function __construct($memoryUsage, $memoryPeakUsage, $padPositionX, $padPositionY) { parent::__construct($padPositionX, $padPositionY); $this->memoryUsage = UnitFormatter::formatByte($memoryUsage); $this->memoryPeak = UnitFormatter::formatByte($memoryPeakUsage); $this->memoryLimit = ini_get("memory_limit"); if (-1 == $this->memoryLimit) { $this->memoryLimit = "-1 (no limit)"; } }
/** * Constructor * @param mixed $applicationConfig application config * @param int $padPositionX x position of the pad in the main screen * @param int $padPositionY y position of the pad in the main screen */ public function __construct($applicationConfig, $padPositionX, $padPositionY) { parent::__construct($padPositionX, $padPositionY); $this->applicationConfig = $applicationConfig; }
/** * {@inheritdoc} */ protected function printRawText($text, $color = ExceptionRendererNcurses::COLOR_DEFAULT) { // if the current position is pointed by the cursor, change the text color to display a white background $x = null; $y = null; ncurses_getyx($this->getPadResource(), $y, $x); if ($y == $this->cursorPositionY) { $color += 10; } // print text parent::printRawText($text, $color); // calculate max Y position ncurses_getyx($this->getPadResource(), $y, $x); if ("\n" == substr($text, -1)) { $y -= 1; } $this->maxY = max($this->maxY, $y); }