protected function getModulesCommands()
    {
        $commands = [];

        foreach (ModuleManager::getInstalledModules() as $module) {
            $cliFile = getLocalPath('modules/' . $module['ID'] . '/cli.php');

            if ($cliFile === false) {
                continue;
            } elseif (!Loader::includeModule($module['ID'])) {
                continue;
            }

            $config = include_once $this->getDocumentRoot() . $cliFile;

            if (isset($config['commands']) && is_array($config['commands'])) {
                $commands = array_merge($commands, $config['commands']);
            }
        }

        return $commands;
    }
protected function getModulesCommands()
    {
        $commands = [];

        foreach (ModuleManager::getInstalledModules() as $module) {
            $cliFile = getLocalPath('modules/' . $module['ID'] . '/cli.php');

            if ($cliFile === false) {
                continue;
            } elseif (!Loader::includeModule($module['ID'])) {
                continue;
            }

            $config = include_once $this->getDocumentRoot() . $cliFile;

            if (isset($config['commands']) && is_array($config['commands'])) {
                $commands = array_merge($commands, $config['commands']);
            }
        }

        return $commands;
    }
protected function getModulesCommands ( ) { $ commands = [ ] ; foreach ( ModuleManager :: getInstalledModules ( ) as $ module ) { $ cliFile = getLocalPath ( 'modules/' . $ module [ 'ID' ] . '/cli.php' ) ; if ( $ cliFile === false ) { continue ; } elseif ( ! Loader :: includeModule ( $ module [ 'ID' ] ) ) { continue ; } $ config = include_once $ this -> getDocumentRoot ( ) . $ cliFile ; if ( isset ( $ config [ 'commands' ] ) && is_array ( $ config [ 'commands' ] ) ) { $ commands = array_merge ( $ commands , $ config [ 'commands' ] ) ; } } return $ commands ; }
Gets console commands from modules.

@return Command[]

@throws \Bitrix\Main\LoaderException
Gets console commands from modules .