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:----kABB5Jj7/Ix0RucAWkSFnRfeSZg7WmjaCZQyfuK/6arqcYv9FJTrcnYgTKzvgX8jpEHjxov3VrcE6eBqEAaepLc7oSmxU8u0T41TYz9fwXSeWFhegeJfeIB2nKLGA+7V8ZtIRa4Q+pUtJaq4+KO0INXnEzWWeK7aKHGi9286E3KsJcd3wlprVjt66bvC6nb/TOoC3RysBhWiNsvYchtDBEcbQQteE3Tyfz5QIjbzDKtsApL0iNgEfpx2RokKgf5w2EqxIc/ZP+RXCgYcmfTZysiSLV8XXxAdijg1/EDVFAPRQYnRc8uyo0cKCMUHgVB3ny20DLGujzfE3fzjRpLMX1p0eHUfYGDTsQ3i4iffj8Nsa67jbcOWzYB0Z9+tGpuSSCxk7aBV4GxAjaUiE1w12UHEEGSm1mWRbxYOp9eY25UXPRlGuCAOKO+0SRquZ3ELybc+hu74clo2ez7noHemv3yXA8QExqeK5QSk2Oo92PoGoeovpW/2Wq0qoMCbsQ4RevhzNqyfxZJT1f18ilvO8R3di5g6lB7plEmtJzs//LhlQefN03jUuFw2IJMHtyVT+eNjXdXON0VB1p0GKxP6o6bMJMmqr8n7P8hkT/xIrIKIS5Gya7Lg6/iG91xS9FnXh1U3hmtUjT+yWlKl/A9QifjNjZz1SQi9rpfzbmYqN30=----ATTACHMENT:----NDY0MzQ0NDc5MDY4MjMwNCAxMzcwNjYxODE5MDg5NDM2IDQ1NDgyMjk4OTAzMjM5OTk=