/** * Runs the initial set up of the processing system */ public function runAction() { try { $this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir()))); $sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile()); $esConfigLocation = ConfigLocation::fromPath(Definition::getSystemConfigDir()); $this->commandBus->dispatch(InitializeEventStore::setUpWithSqliteDbAdapter($sqliteDbFile, $esConfigLocation)); } catch (\Exception $ex) { $this->commandBus->dispatch(UndoSystemSetUp::removeConfigs(Definition::getSystemConfigDir(), Definition::getSystemConfigDir(), Definition::getEventStoreSqliteDbFile())); throw $ex; } return $this->redirect()->toRoute('prooph.link/system_config'); }
/** * @param UndoSystemSetUp $command */ public function handle(UndoSystemSetUp $command) { $this->eventBus->dispatch(ProcessingConfig::removeConfig($command->processingConfigLocation())); $this->eventBus->dispatch(EventStoreConfig::undoEventStoreSetUp($command->eventStoreConfigLocation(), $command->sqliteDbFile())); }