16 use Symfony\Component\Console\Input\InputInterface;
17 use Symfony\Component\Console\Output\OutputInterface;
34 private $objectManagerProvider;
41 private $deploymentConfig;
46 private $upToDateValidators = [];
56 $this->objectManagerProvider = $objectManagerProvider;
62 $this->upToDateValidators = [
63 $this->objectManagerProvider->get()->get(UpToDateDeclarativeSchema::class),
64 $this->objectManagerProvider->get()->get(UpToDateSchema::class),
65 $this->objectManagerProvider->get()->get(UpToDateData::class),
66 $this->objectManagerProvider->get()->get(OldDbValidator::class),
68 parent::__construct();
76 $this->setName(
'setup:db:status')
77 ->setDescription(
'Checks if DB schema or data requires upgrade');
86 if (!$this->deploymentConfig->isAvailable()) {
88 "<info>No information is available: the Magento application is not installed.</info>" 95 foreach ($this->upToDateValidators as $validator) {
96 if (!$validator->isUpToDate()) {
97 $output->writeln(sprintf(
'<info>%s</info>', $validator->getNotUpToDateMessage()));
103 $output->writeln(
'<info>Run \'setup:upgrade\' to update your DB schema and data.</info>');
108 '<info>All modules are up to date.</info>'
const EXIT_CODE_UPGRADE_REQUIRED
execute(InputInterface $input, OutputInterface $output)
__construct(ObjectManagerProvider $objectManagerProvider, DeploymentConfig $deploymentConfig)