$_) { $config = \Bitrix\Main\Config\Configuration::getInstance($moduleId)->get('console'); if (isset($config['commands']) && is_array($config['commands'])) { if (\Bitrix\Main\Loader::includeModule($moduleId)) { foreach ($config['commands'] as $commandClass) { if (is_a($commandClass, \Symfony\Component\Console\Command\Command::class, true)) { $application->add(new $commandClass()); } } } } } // run console $application->run();