9 use Symfony\Component\Console\Command\Command;
10 use Symfony\Component\Console\Input\InputInterface;
11 use Symfony\Component\Console\Output\OutputInterface;
12 use Symfony\Component\Console\Input\InputOption;
37 private $objectManagerFactory;
44 private $deploymentConfig;
56 DeploymentConfig::class
58 parent::__construct();
68 self::INPUT_KEY_GROUP,
70 InputOption::VALUE_REQUIRED,
71 'Run jobs only from specified group' 76 InputOption::VALUE_REQUIRED,
77 'Add or override parameters of the bootstrap' 80 $this->setName(
'cron:run')
81 ->setDescription(
'Runs jobs by schedule')
91 protected function execute(InputInterface $input, OutputInterface
$output)
93 if (!$this->deploymentConfig->get(
'cron/enabled', 1)) {
94 $output->writeln(
'<info>' .
'Cron is disabled. Jobs were not run.' .
'</info>');
107 $bootstrapOptionValues = $bootstrapProcessor->getFromString(
111 if ($bootstrapOptionValue) {
117 $cronObserver->launch();
118 $output->writeln(
'<info>' .
'Ran jobs by schedule.' .
'</info>');
const CUSTOM_ENTRY_POINT_PARAM
const STANDALONE_PROCESS_STARTED
if(defined('TESTS_MAGENTO_INSTALLATION') &&TESTS_MAGENTO_INSTALLATION==='enabled') $bootstrap
const INPUT_KEY_BOOTSTRAP
__construct(ObjectManagerFactory $objectManagerFactory, DeploymentConfig $deploymentConfig=null)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]