mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 09:17:35 +00:00
Applied pull request patch https://github.com/magento/magento2/pull/12441.patch (created by @jalogut) based on commit(s): 1. 8805bc07da432624236a4678258a5c6973545810 2. e47ec9b35325c1c1134f9340784f7e8f79c36c61 3. 13574b461903ad8ac726e09ad3f6de015c670dbb
65 lines
1.7 KiB
PHP
65 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
namespace Magento\Deploy\Console\Command\App;
|
|
|
|
use Magento\Deploy\Model\DeploymentConfig\ChangeDetector;
|
|
use Magento\Framework\Console\Cli;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
/**
|
|
* Command for checking if Config propagation is up to date
|
|
*/
|
|
class ConfigStatusCommand extends Command
|
|
{
|
|
/**
|
|
* Code for error when config import is required.
|
|
*/
|
|
const EXIT_CODE_CONFIG_IMPORT_REQUIRED = 2;
|
|
|
|
/**
|
|
* @var ChangeDetector
|
|
*/
|
|
private $changeDetector;
|
|
|
|
/**
|
|
* ConfigStatusCommand constructor.
|
|
* @param ChangeDetector $changeDetector
|
|
*/
|
|
public function __construct(ChangeDetector $changeDetector)
|
|
{
|
|
$this->changeDetector = $changeDetector;
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function configure()
|
|
{
|
|
$this->setName('app:config:status')
|
|
->setDescription('Checks if config propagation requires update');
|
|
parent::configure();
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
{
|
|
if ($this->changeDetector->hasChanges()) {
|
|
$output->writeln(
|
|
'<info>Config files have changed. ' .
|
|
'Run app:config:import or setup:upgrade command to synchronize configuration.</info>'
|
|
);
|
|
return self::EXIT_CODE_CONFIG_IMPORT_REQUIRED;
|
|
}
|
|
$output->writeln('<info>Config files are up to date.</info>');
|
|
return Cli::RETURN_SUCCESS;
|
|
}
|
|
}
|