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:----j2Yk0osUmIB8wf1c4pP6kANvaseZjnD/6zC0N2mYkkoKa3/HWjUva9ua4br//XH6qA7Om/fftUNoTeAdHLjlccXQGLkjTxMkHuhVXFJ5kjZfoBxd+gwqT6vEcPp2iW8Iv1mMIyzI9XVs33ol06O6YZ0HGoU3zknzKXefE1AMmEgoFnADsizjoQ1iI4dLbxFuoF/IZINJfJbpOYkO5JTCmfWjPRGZ1imoWAwhp5D8v93M3apNneG2skUW4BSQ/80odrpeItf/y7tIBaBNZZvqDsZJiRhcKphcwBc0Hsjn7gFR2qgBwI1UYsfqKPu6w0vMuiwDlioN2TbVaev9F01rF4q635xF5hNXdOxzEBISnGqAirUL97VqU2b/0Qu0wh0hWHYtwf/g+C2nIScs4S3bEwtmvalHM+3Q5/BDKhLvuH3ssc/7kGfSxnXTTF0i3v4uBW5ZJTG4Hivgzb2UiTlEmiSbpiijHFTlzleGFUwYbAiPBQUbai8oB54XsrUzGQmeCJNc7dupRya7TUXO8NgzaT3HfETBPtiJtsbFag0acfpFTFi+6QD5q7nRvLfD6Bx9g/6q3szvuSiUUBXX2s+S4Og96HHCtb6vVuy4xQIDd70OxYReDVgLI9B9sMAurMP298tWQGhmEtZOZmjFX2s/UDxHG92b+nrnhp8EKm/A6ZM=----ATTACHMENT:----Mzc4MDg3MjYyNDg4OTc2OCA1ODYzMjM4Mjg3MTg5MDEwIDQ1MzU2OTk3NzE3MDMxNw==