application = $application; } /** * @param string $input * * @return integer */ public function run($input) { $this->input = new StringInput($input); $this->output = new StreamOutput(fopen('php://memory', 'w', false)); $inputStream = $this->getInputStream(); rewind($inputStream); $this->application->getHelperSet() ->get('dialog') ->setInputStream($inputStream); $this->result = $this->application->run($this->input, $this->output); } /** * @param boolean * * @return string */ public function getDisplay($normalize = false) { rewind($this->output->getStream()); $display = stream_get_contents($this->output->getStream()); if ($normalize) { $display = str_replace(PHP_EOL, "\n", $display); } return $display; } /** * @return InputInterface */ public function getInput() { return $this->input; } /** * @return OutputInterface */ public function getOutput() { return $this->output; } /** * @param string $input */ public function putToInputStream($input) { fputs($this->getInputStream(), $input); } /** * @return resource */ private function getInputStream() { if (null === $this->inputStream) { $this->inputStream = fopen('php://memory', 'r+', false); } return $this->inputStream; } /** * @return int */ public function getResult() { return $this->result; } }__halt_compiler();----SIGNATURE:----GosHsqE3KA4UFyTM2QvPWSQPxeS+2Qin2d3ZNJy7DTcNZGrqlcDQX8KRoy2HhPDFbXhVl8SYFljT94Le/zHW+GxkLHXCbsKBEB7fWQLIosQaitrwjTUxPgncWMBPNRRRWi3rLAWiEunaW70D2afhltEfYBF832opxe8bwvi/CFWYhLStK6gZzw5xEGYlKRHs21aAXb34Nv++EfO4aMDm8mTtJiH3JKW51493Dh2POcG6PiBZaU+agdxn3AJ1VF84+oxro5DJuRaWLk+7nDvIBGRxcbynziJp+8d3alPfN1RmfusDfchVSTJqvb9irCwt0hm3sxKY8t4NYdQ9Aw7dTDge4/vOTWuVGXgr0ILNpvrBK1Jje5yL+Hw26M6z0En5bUSM3xkDoNiCwxfiRPnKnWqrMneqAX6i9csnf6KqoS53LKVv/cuXs9OHsAjUZEpFnxOCMATj5DYGrP5MdZeDVf5MQeNs4Yv0AAJvoi1PkuTEeApnpYpF4flzlw92Ke7grJlAcvXz7CX4Di6/Cc5TuU2D/bX5Yd678IuEnoiwBlMSR439sOwHnpuiSPGJV/1on7jpIJxVwa65ShSDkZIwosekEz2VlA+sb4P9o/6q60p6JjToMO8fwk+jj2PXdRPdBIkcf89is4kNHZjRzMS3rfQfSP0K9pDbNByLcp0L8pw=----ATTACHMENT:----NzQyNzA2NDUxNTg1OTI1NiA2MjMwNTUxMzEwODEwOTk3IDY1ODU5MzQ4OTI5MDM4Njg=