Return all front end modules as array
@return array
760378
public function getTypes()
	{
		$groups = array();

		foreach ($GLOBALS['FE_MOD'] as $k=>$v)
		{
			foreach (array_keys($v) as $kk)
			{
				$groups[$k][] = $kk;
			}
		}

		return $groups;
	}
902485
protected function getModulesAutoloadConfigWithoutCache()
    {
        $result = [];
        foreach ($this->modules as $moduleName => $moduleConfig) {
            $className = $moduleConfig['className'];
            $module    = new $className;
            if (!$module instanceof AbstractModule) {
                $errMsg = sprintf('Class "%s" must be extended from %s', $className, AbstractModule::class);
                throw new Exception\RuntimeException($errMsg);
            }
            $autoloadConfig = $module->getAutoloaderConfig();
            if (!ArrayUtils::isHashTable($autoloadConfig)) {
                $errMsg = sprintf('The autoloader configuration for module "%s" is invalid', $moduleName);
                throw new Exception\RuntimeException($errMsg);
            }
            $result = ArrayUtils::merge($result, $autoloadConfig);
        }
        
        foreach ($result as $moduleName => $configAutoload) {
            foreach ($configAutoload as $key => $value) {
                $result[$moduleName][$key] = realpath($value);
            }
        }
        
        return $result;
    }
1348398
protected function getSiteModules() : array
    {
        $modules    = [];
        $modulePath = $_SERVER['DOCUMENT_ROOT'] . '/../module/MelisSites';

        if (is_dir($modulePath)){
            foreach (scandir($modulePath) as $module) {
                // Skip directory pointers
                if ($module == '.' || $module == '..') continue;

                if (is_dir($modulePath . '/' . $module)) {
                    $modules[$module] = $this->getControllers($modulePath . '/' . $module . '/src/' . $module . '/Controller');
                }
            }
        }

        return $modules;
    }
78535
public function scriptsAll(): array
    {
        $scripts = [];
        foreach ($this->getAll() as $name => $plugin) {
            $scripts[$name] = $plugin->scripts();
        }
        return $scripts;
    }
735583
public function toArray()
    {
        return [
            'id'          => $this->id,
            'module'      => $this->module,
            'bundle'      => $this->bundle,
            'position'    => $this->position,
            'name'        => $this->name,
            'description' => $this->description,
            'category'    => $this->category,
            'active'      => $this->active,
            'tags'        => $this->tags
        ];
    }
419055
public function getSubComponents() {
    $base_path = $this->getBaseComponentPath();

    $filter = function (Extension $module) use ($base_path) {
      return strlen(dirname($module->getPath())) > strlen($base_path);
    };

    return array_filter($this->getAll(), $filter);
  }
1370092
public function toArray()
    {
        return [
            'fileId' => $this->file->getId(),
            'fileVersion' => $this->file->getVersion(),
            'usageType' => $this->usageType,
            'usageId' => $this->usageId,
            'status' => $this->status,
        ];
    }
1352882
public function getCoreModulesByName()
    {
        $coreModules = $this->config->get('society.core.core.CoreModules');
        $coreModules = array_flip($coreModules);

        return collect($coreModules);
    }
683993
public static function getModuleList()
    {
        $app = \JFactory::getApplication();
        $Itemid = $app->input->getInt('Itemid');
        $groups = implode(',', \JFactory::getUser()->getAuthorisedViewLevels());
        $lang = \JFactory::getLanguage()->getTag();
        $clientId = (int) $app->getClientId();

        $db = \JFactory::getDbo();

        $query = new \stdClass;
        $query->select = array();
        $query->from = array();
        $query->join = array();
        $query->where = array();
        $query->order = array();

        $query->select[] = 'm.published, m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params, mm.menuid';
        $query->from[] = '#__modules AS m';
        $query->join[] = '#__modules_menu AS mm ON mm.moduleid = m.id';
        $query->where[] = 'm.published = 1';

        $query->join[] = '#__extensions AS e ON e.element = m.module AND e.client_id = m.client_id';
        $query->where[] = 'e.enabled = 1';

        $date = \JFactory::getDate();
        $now = $date->toSql();
        $nullDate = $db->getNullDate();
        $query->where[] = '(m.publish_up = ' . $db->q($nullDate) . ' OR m.publish_up <= ' . $db->q($now) . ')';
        $query->where[] = '(m.publish_down = ' . $db->q($nullDate) . ' OR m.publish_down >= ' . $db->q($now) . ')';

        $query->where[] = 'm.access IN ('.$groups.')';
        $query->where[] = 'm.client_id = ' . $clientId;
        $query->where[] = '(mm.menuid = ' . (int) $Itemid . ' OR mm.menuid <= 0)';

        // Filter by language
        if ($app->isSite() && $app->getLanguageFilter())
        {
            $query->where[] = 'm.language IN (' . $db->q($lang) . ',' . $db->q('*') . ')';
        }

        $query->order[] = 'm.position, m.ordering';

        // Do 3rd party stuff to change query
        $app->triggerEvent( 'onCreateModuleQuery', array( &$query ) );

        $q = $db->getQuery(true);
        // convert array object to query object
        foreach ( $query as $type => $strings )
        {
            foreach ( $strings as $string )
            {
                if ( $type == 'join' )
                {
                    $q->{$type}( 'LEFT', $string );
                }
                else
                {
                    $q->{$type}( $string );
                }
            }
        }

        // Set the query
        $db->setQuery($q);

        try
        {
            $modules = $db->loadObjectList();
        }
        catch (\RuntimeException $e)
        {
            \JLog::add(\JText::sprintf('JLIB_APPLICATION_ERROR_MODULE_LOAD', $e->getMessage()), \JLog::WARNING, 'jerror');

            return array();
        }

        return $modules;
    }
110849
public function getModules(){
        if($this->loadModules != 'ALL'){
            $this->connection->select('name');
            $this->connection->from($this->tableModule);
            $modules= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC);
            foreach ($modules as $module) {
                $this->getModule($module['name']);
            }
            $this->loadModules= 'ALL';
        }
        return $this->modules;
    }
1058498
public function getModules($current_module = '')
    {
        $st_dir = Config::$dataPath . $this->statisticDir;
        $modules_name_array = array();
        foreach(glob($st_dir."/*", GLOB_ONLYDIR) as $module_file)
        {
            $tmp = explode("/", $module_file);
            $module = end($tmp);
            $modules_name_array[$module] = array();
            if($current_module == $module)
            {
                $st_dir = $st_dir.$current_module.'/';
                $all_interface = array();
                foreach(glob($st_dir."*") as $file)
                {
                    if(is_dir($file))
                    {
                        continue;
                    }
                    list($interface, $date) = explode(".", basename($file));
                    $all_interface[$interface] = $interface;
                }
                $modules_name_array[$module] = $all_interface;
            }
        }
        return $modules_name_array;
    }
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;
	}
152302
private function getPathsOfAvailableModules()
    {
        $config = Registry::getConfig();
        $modulesRootPath = $config->getModulesDir();
        $modulePaths = $config->getConfigParam('aModulePaths');

        if (!is_dir($modulesRootPath))
            return [];

        if (!is_array($modulePaths))
            return [];

        $fullModulePaths = array_map(function ($modulePath) use ($modulesRootPath) {
            return $modulesRootPath . $modulePath;
        }, array_values($modulePaths));

        return array_filter($fullModulePaths, function ($fullModulePath) {
            return is_dir($fullModulePath);
        });
    }
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;
    }
827663
public function listModules()
    {
        $uri = 'asterisk/modules';

        $response = $this->client->getEndpoint()->get($uri);

        $modules = [];
        foreach (\GuzzleHttp\json_decode($response->getBody()) as $module) {
            $modules[] = new Module($module);
        }

        return $modules;
    }
1249719
public function toArray()
    {
        return [
            'name'                      => $this->name,
            'label'                     => $this->label,
            'description'               => $this->description,
            'sandboxed'                 => $this->sandboxed,
            'supports_inline_execution' => $this->supportsInlineExecution,
        ];
    }
409504
public static function getModules()
    {
        return \Cache::remember('modules', 604800, function ()
        {
            $diskModules = Module::getModulesFromDisk();
            if ($diskModules)
                return self::checkModulesInDb($diskModules);
            else
                return [];
        });
    }