/** * @param array $commands * * @return bool */ protected function executeCommands(array $commands) { $exitCode = 0; foreach ($commands as $command => $options) { $code = $this->commandExecutor->runCommand($command, $options, $this->logger); if ($code !== 0) { $exitCode = $code; break; } } return $exitCode === 0; }
/** * {@inheritdoc} */ public function execute(LoggerInterface $logger) { if (empty($this->initialEntityConfigState)) { $this->commandExecutor->runCommand('oro:entity-extend:update-config', [], $logger); } else { $this->createInitialEntityConfigStateFile(); try { $this->commandExecutor->runCommand('oro:entity-extend:update-config', ['--initial-state-path' => $this->initialEntityConfigStatePath], $logger); $this->removeInitialEntityConfigStateFile(); } catch (\Exception $ex) { $this->removeInitialEntityConfigStateFile(); throw $ex; } } }
/** * Executes oro:entity-extend:migration:update-config command * * @param LoggerInterface $logger * @param bool $dryRun * @throws \Exception */ protected function runUpdateConfigCommand(LoggerInterface $logger, $dryRun = false) { $this->createConfigProcessorOptionsFile(); try { $params = []; if ($dryRun) { $params['--dry-run'] = true; $params['--ignore-errors'] = true; } $this->commandExecutor->runCommand('oro:entity-extend:migration:update-config', $params, $logger); $this->removeConfigProcessorOptionsFile(); } catch (\Exception $ex) { $this->removeConfigProcessorOptionsFile(); throw $ex; } }
/** * Update database and generate extended field * * @param bool $generateProxies * @return bool */ public function updateDatabase($generateProxies = true) { set_time_limit(0); $this->maintenance->activate(); $exitCode = 0; foreach ($this->commands as $command => $options) { $code = $this->commandExecutor->runCommand($command, $options, $this->logger); if ($code !== 0) { $exitCode = $code; } } $isSuccess = $exitCode === 0; if ($isSuccess && $generateProxies) { $this->generateProxies(); } return $isSuccess; }
/** * {@inheritdoc} */ public function execute(LoggerInterface $logger) { $this->commandExecutor->runCommand('oro:entity-extend:cache:clear', [], $logger); }
/** * {@inheritdoc} */ public function execute(LoggerInterface $logger) { $this->commandExecutor->runCommand('oro:entity-config:cache:warmup', [], $logger); }
/** * {@inheritdoc} */ public function execute(LoggerInterface $logger) { $this->commandExecutor->runCommand('oro:entity-extend:update-config', [sprintf('--skip-origin=%s', ExtendScope::ORIGIN_CUSTOM)], $logger); $this->commandExecutor->runCommand('oro:entity-extend:cache:clear', [], $logger); }