/** * Load the Peridot environment. * * @return void */ public function load(ReaderInterface $reader) { $this->configuration = $reader->getConfiguration(); require_once $this->configuration->getDsl(); $peridotCallback = (include $this->configuration->getConfigurationFile()); if (is_callable($peridotCallback)) { call_user_func($peridotCallback, $this->emitter); } }
/** * Run the Peridot application * * @param InputInterface $input * @param OutputInterface $output * @return int */ public function doRun(InputInterface $input, OutputInterface $output) { $this->configuration = ConfigurationReader::readInput($input); $this->environment->getEventEmitter()->emit('peridot.configure', [$this->configuration, $this]); $runner = $this->getRunner(); $factory = new ReporterFactory($this->configuration, $output, $this->environment->getEventEmitter()); $this->loadDsl($this->configuration->getDsl()); $this->add(new Command($runner, $this->configuration, $factory, $this->environment->getEventEmitter())); $exitCode = parent::doRun($input, $output); $this->environment->getEventEmitter()->emit('peridot.end', [$exitCode, $input, $output]); return $exitCode; }