Yireo_ExtensionChecker icon indicating copy to clipboard operation
Yireo_ExtensionChecker copied to clipboard

Detect dependencies on console commands

Open norgeindian opened this issue 3 years ago • 3 comments

I know, this surely not easy to implement, but it would be awesome, if usages of console commands could be detected. So for example, we have a module, which calls the regenerate:category:path from https://github.com/elgentos/magento2-regenerate-catalog-urls/blob/master/src/Console/Command/RegenerateCategoryPathCommand.php.

Nothing else from Elgentos_RegenerateCatalogUrls is used, only this console command. So we definitely have a dependency here, which is not detected. If there would be any way to solve that, it would be really appreciated.

norgeindian avatar Oct 13 '22 11:10 norgeindian

The code pretty much looks like this:

$urlPathRegenerateCommand = $application->find('regenerate:category:path');
$input                    = new ArrayInput(['cids' => $categoryIds, '--store' => 'all']);
$output                   = new NullOutput();
$urlPathRegenerateCommand->run($input, $output);

sprankhub avatar Oct 13 '22 11:10 sprankhub

I've picked this up in version 2.2.2 which should now be able to detect CLI dependencies (scanning for find()).

jissereitsma avatar Nov 15 '22 11:11 jissereitsma

Nice - I guess we can close this, then :)

sprankhub avatar May 09 '23 08:05 sprankhub