private function statusbar($str, $in = false) { static $lines = false; if (!$lines) { $lines = array_fill(0, self::OUTPUT_ROWS, array('str' => '', 'in' => '')); } $lines[] = array('str' => $str, 'in' => $in); array_shift($lines); echo "7[1;1f[2K"; foreach ($lines as $line) { $text = str_pad(substr(($line['in'] ? ' < ' : ' > ') . $line['str'], 0, Misc::cols()), Misc::cols()); if ($line['in']) { echo Style::red($text, 'light_gray'); } else { echo Style::black($text, 'light_gray'); } } echo str_repeat('─', Misc::cols()); echo "8"; }
public function dropError($text, $code = 1, $additional = false) { Output::string($this->getScript() . ": " . Style::red($text) . PHP_EOL . ($additional ? $additional . PHP_EOL : '')); die($code); }