Returns a collection of missing modules

@return array
773177
public function getMissingCoreModules()
    {
        $modules = array();

        foreach ($this->coreModules as $module) {
            if (!$this->isLoadedModule($module)) {
                array_push($modules, $module);
            }
        }

        return $modules;
    }
319320
public function getAllModules()
    {
        $modules = array_map(function ($value) {
            return $this->loadModule($value);
        }, $this->registry->getMap());

        return array_filter($modules, function ($module) {
            return !is_null($module);
        });
    }
922066
public function modules(): array
    {
        $modules = [];

        foreach (glob(__DIR__ . '/*.php') as $module) {
            $className = basename($module, '.php');
            $class = __NAMESPACE__ . '\\' . $className;
            $config = $this->modulesPath . '/' . strtolower("{$className}.inc");
            $interfaces = class_implements($class);

            if (!in_array('TwigWp\Module\Injectable', $interfaces, true)) {
                continue;
            }

            if (file_exists($config)) {
                /** @noinspection PhpIncludeInspection */
                $config = require_once $config;
                $modules[$className] = new $class($config);
                continue;
            }

            $modules[$module] = new $class();
        }

        /**
         * Filter Modules
         *
         * @since 1.0.0
         *
         * @param array $modules The registered modules.
         * @param \Twig\Environment $twig The Twig Environment Instance.
         */
        $modules = apply_filters('twigwp.modules', $modules, $this->twig);

        return array_filter($modules);
    }
631349
public static function getSrcModules()
    {
        $modules = [];
        foreach (new \DirectoryIterator(BASE_PATH . 'src') as $module) {
            if (!$module->isDir() || $module->isDot() || !self::_moduleValid($module->getPathname())) {
                continue;
            }
            $modules[] = $module->getPathname();
        }
        return $modules;
    }
1130524
public function getCoreModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $coreModules = $this->all()->filter(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $coreModules->all();
    }
875226
public function getModulesFromRepository()
    {
        $modules = array();

        $system = $this->systemService->getActiveSystem();

        foreach($this->repositories as $repository){
            // Retrieve compatible modules.
            $client = new Client([
                'base_uri' => $repository,
            ]);
            $response = $client->get('d/'.$system->getPackage().'/'.$this->distributionVersion.'.json');
            $compatibleModules = json_decode($response->getBody());
            // TODO: What to do if same module exists in different repositories?
            $modules = array_merge($modules, $compatibleModules->results);
        }

        if(count($modules) === 0){
            return self::STATUS_NO_MODULES;
        }

        return $modules;
    }
14038
public function getModules(){
		$modules=array();
		$db=BFactory::getDBO();
		if(empty($db)){
			return $modules; //False?
			}
		$qr='SELECT * from `soft_modules_rules` where pageid='.$this->id;
		$q=$db->Query($qr);
		if(empty($q)){
			return $modules; //False?
			}
		while($l=$db->fetch($q)){
			$id=(int)$l['id'];
			$modules[$id]=new BSoftModule();
			$modules[$id]->group=$this;
			$modules[$id]->load($l);
			}
		return $modules;
		}
405710
public function all()
    {
        $modules = new Collection($this->module->all());

        foreach ($modules as $module) {
            $module = $this->get($module);
        }

        return $modules;
    }
603639
public function softmodules_list(){
		$list=array();
		foreach($this->components as $com){
			$controller=$this->component_load($com);
			if(empty($controller)){
				continue;
				}
			$clist=$controller->softmodules_list();
			$list=array_merge($list,$clist);
			}
		return $list;
		}
1165906
public function getSortedModules()
    {
        $i18nOrder = Sources::config()->uninherited('module_priority');
        $sortedModules = [];
        if ($i18nOrder) {
            Deprecation::notice('5.0', sprintf(
                '%s.module_priority is deprecated. Use %s.module_priority instead.',
                __CLASS__,
                ModuleManifest::class
            ));
        }

        foreach (ModuleLoader::inst()->getManifest()->getModules() as $module) {
            $sortedModules[$module->getName()] = $module->getPath();
        };

        return $sortedModules;
    }
840232
public function getThirdPartyModules()
    {
        $coreModulesByName = $this->getCoreModulesByName();

        $thirdPartyModules = $this->all()->reject(
            function ($module) use ($coreModulesByName) {
                return array_key_exists($module->getLowerName(), $coreModulesByName->toArray());
            });

        return $thirdPartyModules->all();
    }
670620
public function findForActiveModules()
    {
        $fs = new Filesystem();

        $codes = $this->queryActiveModuleCodes();

        foreach ($codes as $key => $code) {
            // test if the module exists on the file system
            if (!$fs->exists(THELIA_MODULE_DIR . $code)) {
                unset($codes[$key]);
            }
        }

        // reset keys
        $codes = array_values($codes);

        return $this->findForModules($codes);
    }
890263
public function getModulesWithoutRelations(array $modules) : array
    {
        $result = [];
        foreach ($modules as $moduleName => $module) {
            if (isset($module['relations']) && is_array($module['relations']) && ! empty($module['relations'])) {
                continue;
            }
            $result[] = $moduleName;
        }

        return $result;
    }
1121414
public function getModules($inited=false)
	{
	    if ($inited) {
	        $instances = [];
	        if ($this->_modules) foreach ($this->_modules as $v) {
	            $instances[] = $this->getModule($v);
	        }
	        return $instances;
	    }
	    
		return $this->_modules;
	}
1360206
public function scanModules() {
        $modules = RtCache::get('loader@modules');
        if (!$modules) {
            $modules = [];
            if (is_dir(MODULE_ROOT)) {
                $it = new \DirectoryIterator (MODULE_ROOT);
                foreach ($it as $dir) {
                    if ($dir->isDot()) {
                        continue;
                    }
                    if ($dir->isDir()) {
                        $dirname = $dir->getFilename();
                        $boot    = MODULE_ROOT . $dirname . '/bootstrap.php';
                        if (is_file($boot)) {
                            $modules[ $dirname ] = $boot;
                        }
                    }
                }
            }
            RtCache::add('loader@modules', $modules);
        }

        return $modules;
    }
545467
private function getModules()
    {
        $modules = (array)$this->xml->xpath('/draggy/module');

        $r = '';

        foreach ($modules as $module) {
            $moduleAttributes = (array)$module;
            $moduleAttributes = (array)$moduleAttributes['@attributes'];

            $this->checkMandatoryAttributes('Modules', $moduleAttributes, ['name', 'left', 'top', 'width', 'height']);

            $moduleName = $moduleAttributes['name'];

            $r .= 'var o = new Container(\'' . str_replace('\\', '\\\\', $moduleName) . '\');' . PHP_EOL;
            $r .= 'o.moveTo(\'' . ( $moduleAttributes['left'] - 1 ) . 'px\',\'' . ( $moduleAttributes['top'] - 1 ) . 'px\',\'' . $moduleAttributes['width'] . 'px\',\'' . $moduleAttributes['height'] . 'px\')' . PHP_EOL;

            $this->modules[]                    = $moduleName;
            $this->insideClasses[$moduleName]   = [];
            $this->insideAbstracts[$moduleName] = [];
        }

        return $r;
    }
1048274
public function getModulesFromDir()
	{
		$moduleList = array();
		$moduleVendorPath = Yii::getPathOfAlias('application.vendor.ommu');
		if (file_exists($moduleVendorPath)) {
			$modules = scandir($moduleVendorPath);
			foreach($modules as $module) {
				$moduleFile = $moduleVendorPath.'/'.$module.'/'.ucfirst($module).'Module.php';
				if (file_exists($moduleFile)) {
					$moduleName = strtolower(trim($module));
					if(!in_array($moduleName, $this->getIgnoreModule())) {
						$moduleList[] = $moduleName;
					}
				}
			}
		}
		
		$modulePath = Yii::getPathOfAlias('application.modules');
		if (file_exists($modulePath)) {
			$modules = scandir($modulePath);
			foreach($modules as $module) {
				$moduleFile = $modulePath.'/'.$module.'/'.ucfirst($module).'Module.php';
				if (file_exists($moduleFile)) {
					$moduleName = strtolower(trim($module));
					if(!in_array($moduleName, $moduleList)) {
						if(!in_array($moduleName, $this->getIgnoreModule())) {
							$moduleList[] = $moduleName;
						}
					}
				}
			}
		}

		if(count($moduleList) > 0)
			return $moduleList;
		else
			return false;
	}