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:----o5u80kUP2nAGfULXGRmI4VpHbGjJlDVNaIDYq2KzHORu5yYtpZ8UCmfwPNf0yswgJFB6s9m6f7HlmHhZrZWbghCBFyDd0FrKx1xb24xqMyQ23Wk4gK9+t/+1mqGykuP0huo2wUaqMRc8n06/7lhldoFCABU44W67whdSoQMvvnkOzPBdtODnNhuXDmJCvbsigQbQ3wwkibrA91vsFoQf3Bd+unVa3nvNvEqGRURpf0mr1aLYtXVC4xi0nGWRCG9wD7cxSlCe4lCwdW9FCLc1cokPlVEcwC5qcEwZ2szbwmBUjoWuO5kLbrrhc+uuoqVaVHtVgIFKknFBrvda7V1KHpI892jPyoizqY+4e+piMEugLPc8LcnT8AQfhgueIMVEPYMm7CzPnElnp/kRQjEzAGGF2LH8ZjFuWAXJCIjacSka0jk32g4UIJcdp7TexyJ8BYyvpsyp12fk4I2J7UvMA5yZqHR3m9mTuF4cgvN5Ocu6JqXP5My6W0RVPaQabEAdgzxDmAOz3M9sq/oeHE6tjwiqm9xrfP8zSpeojBnOEkDWoj6tfcS2czp/z0CRtNrTIJfnXIawprdaaB0CobQIIYFOog6vGOWXNfgYCw0eFNLSdoWqobUWl85QSb2EDMI6XKbKgB4z86SpbrrEZUISkiG/XlFyuL/GWAs8SKAdZi0=----ATTACHMENT:----OTY2ODE3MDYwNDQzOTY0OCAyNDc3MTA0OTkwNjg2MzkyIDQ3NDA4Mzk1MDQ4NzU5NjM=