src/Core/CommandCollector.php
private function getCommandsFromModules()
    {
        $oConfig = Registry::getConfig();


        if (! class_exists(ModuleList::class)) {
            print "ERROR: Oxid ModuleList class can not be loaded, please run vendor/bin/oe-eshop-unified_namespace_generator";
        } else {
            try {
                $moduleList = oxNew(ModuleList::class);
                $modulesDir = $oConfig->getModulesDir();
                $moduleList->getModulesFromDir($modulesDir);
            } catch (\Throwable $exception) {
                print "Shop is not able to list modules\n";
                print $exception->getMessage();
                return [];
            }
        }

        $paths = $this->getPathsOfAvailableModules();
        $pathToPhpFiles = $this->getPhpFilesMatchingPatternForCommandFromGivenPaths(
            $paths
        );
        $classes = $this->getAllClassesFromPhpFiles($pathToPhpFiles);
        $comanndClasses = $this->getCommandCompatibleClasses($classes);
        return $this->getObjectsFromClasses($comanndClasses);
    }
private function getCommandsFromModules()
    {
        $oConfig = Registry::getConfig();


        if (! class_exists(ModuleList::class)) {
            print "ERROR: Oxid ModuleList class can not be loaded, please run vendor/bin/oe-eshop-unified_namespace_generator";
        } else {
            try {
                $moduleList = oxNew(ModuleList::class);
                $modulesDir = $oConfig->getModulesDir();
                $moduleList->getModulesFromDir($modulesDir);
            } catch (\Throwable $exception) {
                print "Shop is not able to list modules\n";
                print $exception->getMessage();
                return [];
            }
        }

        $paths = $this->getPathsOfAvailableModules();
        $pathToPhpFiles = $this->getPhpFilesMatchingPatternForCommandFromGivenPaths(
            $paths
        );
        $classes = $this->getAllClassesFromPhpFiles($pathToPhpFiles);
        $comanndClasses = $this->getCommandCompatibleClasses($classes);
        return $this->getObjectsFromClasses($comanndClasses);
    }
private function getCommandsFromModules ( ) { $ oConfig = Registry :: getConfig ( ) ; if ( ! class_exists ( ModuleList :: class ) ) { print "ERROR: Oxid ModuleList class can not be loaded, please run vendor/bin/oe-eshop-unified_namespace_generator" ; } else { try { $ moduleList = oxNew ( ModuleList :: class ) ; $ modulesDir = $ oConfig -> getModulesDir ( ) ; $ moduleList -> getModulesFromDir ( $ modulesDir ) ; } catch ( \ Throwable $ exception ) { print "Shop is not able to list modules\n" ; print $ exception -> getMessage ( ) ; return [ ] ; } } $ paths = $ this -> getPathsOfAvailableModules ( ) ; $ pathToPhpFiles = $ this -> getPhpFilesMatchingPatternForCommandFromGivenPaths ( $ paths ) ; $ classes = $ this -> getAllClassesFromPhpFiles ( $ pathToPhpFiles ) ; $ comanndClasses = $ this -> getCommandCompatibleClasses ( $ classes ) ; return $ this -> getObjectsFromClasses ( $ comanndClasses ) ; }
Collect all available commands from modules.

Dynamically scan all modules and include available command objects.

@return array
Collect all available commands from modules .