Returns all the important modules

@param array $excludeModulesOnReturn | exclude some modules that you don't want to be included in return

@return array
558583
public function getCoreModules($excludeModulesOnReturn = [])
    {
        $modules = [
            'melisdbdeploy' => 'MelisDbDeploy',
            'meliscomposerdeploy' => 'MelisComposerDeploy',
            'meliscore' => 'MelisCore',
            'melissites' => 'MelisSites',
            'melisassetmanager' => 'MelisAssetManager',
        ];

        if ($excludeModulesOnReturn) {
            foreach ($excludeModulesOnReturn as $exMod) {
                if (isset($modules[$exMod]) && $modules[$exMod]) {
                    unset($modules[$exMod]);
                }
            }
        }

        return $modules;
    }
203651
public function getModules($recursive)
    {
        if (!is_bool($recursive)) {
            throw new \Erebot\InvalidValueException(
                'Invalid value for recursion'
            );
        }

        if ($recursive && $this->proxified !== $this) {
            $inherited = $this->proxified->getModules(true);
        } else {
            $inherited = array();
        }

        $added      = array();
        $removed    = array();
        foreach ($this->modules as $name => $module) {
            if ($module->isActive()) {
                $added[]    = $name;
            } else {
                $removed[]  = $name;
            }
        }

        $inherited = array_diff($inherited, $removed);
        return array_merge($added, $inherited);
    }
551377
function removeExcludedModules(modules, packageForceExcludes, log) {
  const excludedModules = _.remove(modules, externalModule => {   // eslint-disable-line lodash/prefer-immutable-method
    const splitModule = _.split(externalModule, '@');
    // If we have a scoped module we have to re-add the @
    if (_.startsWith(externalModule, '@')) {
      splitModule.splice(0, 1);
      splitModule[0] = '@' + splitModule[0];
    }
    const moduleName = _.first(splitModule);
    return _.includes(packageForceExcludes, moduleName);
  });

  if (log && !_.isEmpty(excludedModules)) {
    this.serverless.cli.log(`Excluding external modules: ${_.join(excludedModules, ', ')}`);
  }
}
701901
public function getModulesForSelect()
    {
        $modules = config('typicms.modules');
        $options = ['' => ''];
        foreach ($modules as $module => $properties) {
            if (in_array('linkable_to_page', $properties)) {
                $options[$module] = __(ucfirst($module));
            }
        }
        asort($options);

        return $options;
    }
553316
protected function getListModules($modulesModel)
    {
        $modules = array();
        foreach ($modulesModel as $module)
        {
            $modules[$module->module_name]['name'] = $this->def($module->module_name, 'name');
            $modules[$module->module_name]['icon'] = $this->getConfig('assets').'/'.$module->module_name.'/'.$this->def($module->module_name, 'icon');
            $modules[$module->module_name]['description'] = $this->def($module->module_name, 'description');
            $modules[$module->module_name]['author'] = $this->def($module->module_name, 'author');
            $modules[$module->module_name]['website'] = $this->def($module->module_name, 'website');
            $modules[$module->module_name]['version'] = $this->def($module->module_name, 'version');
        }
        return $modules;
    }
8014
public function getModules(FilterInterface $filter = null)
    {
        if ($filter !== null) {
            return $filter->filter($this->modules);
        }

        return $this->modules;
    }
635407
public function deletedModules(): Collection
    {
        $database_modules = DB::table('module')->pluck('module_name');

        $disk_modules = $this->all(true)
            ->map(static function (ModuleInterface $module): string {
                return $module->name();
            });

        return $database_modules->diff($disk_modules);
    }
800064
protected function getModules()
    {
    	$file = json_decode( file_get_contents( $this->packagist . 'packages.json' ) )->includes;
    	$file = json_decode( file_get_contents( $this->packagist . key( $file ) ) );
    	return $this->normaliseData( $file->packages );
    }
1359538
public function getVendorModules()
    {
        $repos = $this->getComposer()->getRepositoryManager()->getLocalRepository();

        $packages = array_filter($repos->getPackages(), function ($package) {
            /** @var CompletePackage $package */
            return $package->getType() === 'melisplatform-module' &&
                array_key_exists('module-name', $package->getExtra());
        });

        $modules = array_map(function ($package) {
            /** @var CompletePackage $package */
            return $package->getExtra()['module-name'];
        }, $packages);

        sort($modules);

        return $modules;
    }
1248441
public function findBundleClasses(): array
    {
        /** @var string[][] $bundleSets */
        $bundleSets = [];

        $modules = $this->packageRepository->findModules();
        foreach ($modules as $module) {
            $extra = $module->getExtra();
            $this->validateBundlesSectionInExtra($extra);
            if (empty($extra['phplist/core']['bundles'])) {
                continue;
            }

            $bundleSets[$module->getName()] = $extra['phplist/core']['bundles'];
        }

        return $bundleSets;
    }
61315
public static function getModuleNamesWithoutRoot(Args $args, ModuleList $modules)
    {
        // Display all modules if "all" is set
        if ($args->isOptionSet('all')) {
            return $modules->getInstalledModuleNames();
        }

        $moduleNames = array();

        foreach ($args->getOption('module') as $moduleName) {
            $moduleNames[] = $moduleName;
        }

        return $moduleNames ?: $modules->getInstalledModuleNames();
    }
382508
protected function getListModule()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->module->getList();
            $this->limitArray($list);
            return $list;
        }

        $module = $this->module->get($id);

        if (empty($module)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($module);

    }
1118115
public function moduleLinks($ignoredModules = [], $linkClass = 'nav-link', $listClass = 'nav-item')
    {
        $links = '';

        $modules = config('cms.modules', []);

        foreach ($ignoredModules as $ignoredModule) {
            if (in_array(strtolower($ignoredModule), array_keys($modules))) {
                unset($modules[strtolower($ignoredModule)]);
            }
        }

        foreach ($modules as $module => $config) {
            $link = $module;

            if (isset($config['url'])) {
                $link = $config['url'];
            }

            $displayLink = true;

            if (isset($config['is_ignored_in_menu']) && $config['is_ignored_in_menu']) {
                $displayLink = false;
            }

            if ($displayLink) {
                $links .= '<li class="'.$listClass.'"><a class="'.$linkClass.'" href="'.url($link).'">'.ucfirst($link).'</a></li>';
            }
        }

        return $links;
    }
1237560
static function Modules($bundleName, ModuleLocation $location)
    {
        $result = array();
        $modulesFolder = Path::Combine(self::BundleFolder($bundleName), 'Modules');
        $folder = Path::Combine($modulesFolder, (string)$location);
        if (!Folder::Exists($folder)) {
            return $result;
        }
        $files = Folder::GetFiles($folder);
        foreach ($files as $file)
        {
            $result[] = Path::RemoveExtension($file);
        }
        return $result;
    }
231764
protected function getAllModules()
    {
        return $this->extensionManager->discoverModules()
                    ->showInstalled()
                    ->showUninstalled()
                    ->showNoCore()
                    ->showCore()
                    ->getList(true);
    }
151512
public function getContentModules()
    {
        return array_filter($this->getModules(), function (ModuleInterface $module) {
            return !($module instanceof AdministrationModuleInterface)
                && !($module instanceof SubmoduleInterface);
        });
    }
1142167
public static function cleanModuleList($modules)
    {
        $app = \JFactory::getApplication();

        // Apply negative selections and eliminate duplicates
        $Itemid = \JFactory::getApplication()->input->getInt('Itemid');
        $negId = $Itemid ? -(int) $Itemid : false;
        $clean = array();
        $dupes = array();

        foreach ($modules as $i => $module)
        {
            // The module is excluded if there is an explicit prohibition
            $negHit = ($negId === (int) $module->menuid);

            if (isset($dupes[$module->id]))
            {
                // If this item has been excluded, keep the duplicate flag set,
                // but remove any item from the modules array.
                if ($negHit)
                {
                    unset($clean[$module->id]);
                }

                continue;
            }

            $dupes[$module->id] = true;

            // Only accept modules without explicit exclusions.
            if ($negHit)
            {
                continue;
            }

            $module->name = substr($module->module, 4);
            $module->style = null;
            $module->position = strtolower($module->position);

            $clean[$module->id] = $module;
        }

        unset($dupes);

        // Do 3rd party stuff to manipulate module array.
        // Any plugins using this architecture may make alterations to the referenced $modules array.
        // To remove items you can do unset($modules[n]) or $modules[n]->published = false.

        // "onPrepareModuleList" may alter or add $modules, and does not need to return anything.
        // This should be used for module addition/deletion that the user would expect to happen at an
        // early stage.
        $app->triggerEvent( 'onPrepareModuleList', array( &$clean ) );

        // "onAlterModuleList" may alter or add $modules, and does not need to return anything.
        $app->triggerEvent( 'onAlterModuleList', array( &$clean ) );

        // "onPostProcessModuleList" allows a plugin to perform actions like parameter changes
        // on the completed list of modules and is guaranteed to occur *after*
        // the earlier plugins.
        $app->triggerEvent( 'onPostProcessModuleList', array( &$clean ) );

        // Remove any that were marked as disabled during the preceding steps
        /*foreach ( $clean as $id => $module )
        {
            if ( !isset( $module->published ) || $module->published == 0 )
            {
                unset( $clean[$id] );
            }
        }*/

        // Return to simple indexing that matches the query order.
        return array_values($clean);
    }