Example #1
0
 /**
  * Construct an instance
  * @param array $options Optional array of name/value options
  * @see Options
  */
 public function __construct(array $options = NULL)
 {
     try {
         parent::__construct($options);
         $this->runnable = TRUE;
     } catch (OptionException $e) {
         $result = new RunResult();
         $result->setStatus(Result::FAIL);
         $result->addError($e);
         $this->doOutput($result);
     }
 }
Example #2
0
File: Engine.php Project: g4z/poop
 /**
  * Handle the execute action
  * @return RunResult
  */
 public function doRun()
 {
     $this->debug(__METHOD__, __LINE__);
     $result = new RunResult();
     try {
         //ob_start();
         if (mb_strlen($this->getCode())) {
             $this->parse();
         }
     } catch (EofException $e) {
     } catch (Exception $e) {
         $this->error($e);
         $result->setStatus(Result::FAIL);
         $result->addError($e);
     }
     // $result->setOutput(ob_get_contents());
     // ob_end_clean();
     $result->setData($this->getMemory()->getData());
     return $result;
 }