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:----e87C1Imx0EtvTrN3jKxg5Us8BI+jFx+1tBw0HMbnpwCi//JT+Swsb8Dm841cQtdF2LJpxIsdLwgFeDArpVlSBpYWN7FyWHH748ZGGGHT+XOKAYSOmrvgOgwD370MZgcWxRUPHK8vS+7Qmjs97uROUYgEDh6+tBTlV04wWCcSqJF5HSFo1XAzZuOGWLu66/chW7a7O/s8Fr2SY6okLHHiiL4n9942eQ1Ci0sVT/NV8kBsXa43VO63GHmEJXkUxQVDJU9kXQPF/YlJGSOpU1e0jjq7PyXo4lZSGErynQtQiEVnqzAHN/sKutyIaCz2fcSwyZS5djOcCX8mFnlj864Ad5sT9fK0J3FtGTAcEin+bGze/6wyfjY3dM88SVJQdp/a83xR+QNjHpk6WDA1CKTLm8uWPbeKhv+WQlNtENyGtJMsJ6D/M/DEIz6S3cmlPXBHo3kEosf3ZNMPeorkScKBcnBygB3S3g4LpTBKpFjCaHlzYPh/iOiU7kPln9mHqbd8pCisMOUZq0ajt7SnGTjGIEQHhtiQSGPxoSpAqfLZxYSqcTI8OtUhXEtOiHA2bxfyAzsqGiYRHyg67Fs4js5NUp7yXe95+MA23B/0UPlfq0rYqdTutwK0W/80Yi31cLfH395Ux7McT+1yco584pZ8kcw1WQSQlLRwPhimuDNw4wg=----ATTACHMENT:----ODIwOTI0MzQ0NDQ4ODU0OCA4MjQ1Mjg1NzAzODQ3NzY1IDEyNTEyNDE5OTc5MzAwNjg=