mode = $mode; $this->checkMessage = $checkMessage; switch ($mode) { case 'always': case 'never': $this->buffer = null; break; case 'error': $this->buffer = []; break; default: throw new \InvalidArgumentException("Unrecognized passthru mode: $mode"); } } private function onBufferMessage($method, $args) { $this->buffer[] = [$method, $args]; if ($this->mode === 'flushing') { return; } $isError = false; $messages = (array)$args[0]; foreach ($messages as $message) { if (call_user_func($this->checkMessage, $message, $method)) { $isError = true; break; } } if ($isError) { $this->mode = 'flushing'; for ($i = 0; $i < count($this->buffer); $i++) { call_user_func_array([$this->delegate, $this->buffer[$i][0]], $this->buffer[$i][1]); } $this->mode = 'always'; $this->buffer = null; } } public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeRaw( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeErrorRaw( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function write($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->write($messages, $newline, $verbosity); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeError( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->overwrite( $messages, $newline, $size, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $size, $verbosity] ); } } public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->overwriteError( $messages, $newline, $size, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $size, $verbosity] ); } } } __halt_compiler();----SIGNATURE:----lQINYyM+9OJjzNlkxCEwh9UH35sW5DbHEP+t2WW5DYIIfgAOHxyXBx56YNHaEs1JhfSrnxyEATJNC2d7kmh8X+pQfg7SMkAoO66ZGYtvMzf8kqw/MWiUCEJcZ23dMB8aQ1BDoa4P4G7Q8GRyNcttSJ7rsPYoN4sw+R+HVLEOn4y5v3tec2NcBWIt0/wTfz0UskiDE9EHJEtghXJhnZVViiTMOmJ9mJBcapIYEP42S+gOu7eoQjEj/Ykpqz6q3Z55mqlsWKRk4yvKMPmLsHW7GaOH0JLfuatHZhPlR+BDMcrSdNp0PMNjDo/roqrXJ/+DxrvlavWSizUNPGwl3s6aTf8aDwe6rePXFngwAaqZbhOaI8GWruj12grZmt0HHQecE3hMGqONfO+WRp75yV+AiTS5e8cRMRaXkzISwFz4QKD93wuuCZV/7lFiLkue1m/SUc9L/+lxpLDZfTtVAOavxuELMeODWrsRNH97JoX3wYB1uKyuPJDxV1BnzwXx+4TVplkm6HK6Ds4TxNyYctK5yB+dv/QQvrODh6JxWjhd21najR3BgCX9PdxE+EOieJbNJDl8MxhhOnFQ+USAdXEdBk8WEWH9FaDaE27lZmM2QndCQAcflLpr5ZOkdO7dnHL5gmfrMXSduipbqMPJAo9+Kc36KWspNgvxWHpk+cteda8=----ATTACHMENT:----MzA4OTQxMjIwNDEwNzk4MSA3MTMxMTcwNTQ2MDQ1MzY5IDU4MjI4Mzc4MTg2NTI2MjU=