Get module definition as an array

@param string $module
@return array
17397
public function getModuleDefinition($module)
    {
        $module = strtolower($module);
        
        if (!array_key_exists($module, $this->definitions)) {
            $path = $this->locateModule($module);
            $config = array();
    
            if($path){
    
                $definition = $path . DIRECTORY_SEPARATOR . $this->getOption('definition_file');
    
                /**
                 * Read version from definition file (e.g. definition.ini)
                 * from either module directory or PHAR archive
                */
                if(is_dir($path) && file_exists($definition)){
                    $config = \Zend\Config\Factory::fromFile($definition);
                } else if(is_file($path) && file_exists('phar://'.$definition)){
                    $config = \Zend\Config\Factory::fromFile('phar://'.$definition);
                }
            }
    
            $this->definitions[$module] = $config;
        }
    
        return $this->definitions[$module];
    }
1351712
protected function initContainer($module)
    {
        $map = [];

        $defaultClassMap = [

            /* MODELS */
            'Menu' => Menu::class,
            'MenuLang' => MenuLang::class,
            'Page' => Page::class,
            'PageLang' => PageLang::class,
            'PageItem' => PageItem::class,
            'PageItemLang' => PageItemLang::class,
            'PageSettings' => PageSettings::class,

            /* QUERIES */
            'MenuQuery' => MenuQuery::class,
            'MenuLangQuery' => MenuLangQuery::class,
            'PageQuery' => PageQuery::class,
            'PageLangQuery' => PageLangQuery::class,
            'PageItemQuery' => PageLangQuery::class,
            'PageItemLangQuery' => PageItemLangQuery::class,

            /* SEARCH */
            'PageSearch' => PageSearch::class
        ];

        $routes = [
            'mrstroz\\wavecms\\page\\models' => [
                'Menu',
                'MenuLang',
                'Page',
                'PageLang',
                'PageItem',
                'PageItemLang',
                'PageSettings',
            ],
            'mrstroz\\wavecms\\models\\page\\query' => [
                'MenuQuery',
                'MenuLangQuery',
                'PageQuery',
                'PageLangQuery',
                'PageItemQuery',
                'PageItemLangQuery',
            ],
            'mrstroz\\wavecms\\models\\page\\search' => [
                'PageSearch'
            ]
        ];

        $mapping = array_merge($defaultClassMap, $module->classMap);

        foreach ($mapping as $name => $definition) {
            $map[$this->getContainerRoute($routes, $name) . "\\$name"] = $definition;
        }

        $di = Yii::$container;

        foreach ($map as $class => $definition) {
            /** Check if definition does not exist in container. */
            if (!$di->has($class)) {
                $di->set($class, $definition);
            }
        }

    }
92403
public function getAppRoutes($module = null)
    {
        if ($module === null) {
            $module = Yii::$app;
        } elseif (is_string($module)) {
            $module = Yii::$app->getModule($module);
        }
        $key = [__METHOD__, $module->getUniqueId()];
        if (($result = Yii::$app->cache->get($key)) === false) {
            $result = [];
            $this->getRouteRecrusive($module, $result);
            Yii::$app->cache->set($key, $result, Yii::$app->getAuthManager()->cacheDuration, new TagDependency([
                'tags' => self::CACHE_TAG,
            ]));
        }

        return $result;
    }
1116202
protected function Modules($bundle)
    {
        $modules = PathUtil::BackendModules($bundle);
        $result = array();
        foreach ($modules as $module)
        {
            $instance = ClassFinder::CreateBackendModule(ClassFinder::CalcModuleType($bundle, $module));
            if ($instance instanceof BackendModule)
            {
                $result[] = $module;
            }
        }
        return $result;
    }
122092
public function get(Module $module)
    {
        $moduleName = $module->getName();

        if (Lang::has("$moduleName::module.title")) {
            $module->localname = Lang::get("$moduleName::module.title");
        } else {
            $module->localname = $module->getStudlyName();
        }

        if (Lang::has("$moduleName::module.description")) {
            $module->description = Lang::get("$moduleName::module.description");
        }

        $package = $this->packageVersion->getPackageInfo("societycms/module-$moduleName");

        if (isset($package->name) && strpos($package->name, '/')) {
            $module->vendor = explode('/', $package->name)[0];
        }

        $module->version = isset($package->version) ? $package->version : 'N/A';
        $module->versionUrl = '#';

        $module->isCore = $this->isCoreModule($module);

        if (isset($package->source->url)) {
            $packageUrl = str_replace('.git', '', $package->source->url);
            $module->versionUrl = $packageUrl.'/tree/'.$package->dist->reference;
        }

        $module->license = $package->license;

        return $module;
    }
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);
        });
    }
30997
private static function getModuleFromDB($module){
        $data=Cache::get(md5("config_".$module));
        if(!$data){
            $config=self::get("config");
            $table=$config&&key_exists('db_table',$config)?$config['db_table']:"config";
            $module_key=$config&&key_exists('module_field',$config)?$config['module_field']:"module";
            $content=$config&&key_exists('content_field',$config)?$config['content_field']:"content";
            $data= Select::table($table)
                ->where($module_key,$module)
                ->value($content);
            Cache::set(md5("config_".$module),$data);
        }
        if($data){
            $data=json_decode($data,true);
        }
        return $data;
    }
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;
    }
187194
public function getSubmodules($module)
    {
        $submodsConfig = static::submodsConfig();
        $result = [];
        foreach ($submodsConfig as $submodUniqueId => $config) {
            if (($pos = strrpos($submodUniqueId, '/')) !== false) {
                $parentUid = substr($submodUniqueId, 0, $pos);
                $moduleId = substr($submodUniqueId, $pos + 1);
            } else {
                $parentUid = ''; // Yii::$app
                $moduleId = $submodUniqueId;
            }
            if ($parentUid == $module->uniqueId) {
                $result[$moduleId] = $config;
            }
        }
        return $result;
    }
1154243
public function readTranslation($module) {
		
		// get the right translation folder
		$file = APPLICATION_PATH . (is_a($module,'Pair\Module') ? '/modules/' . $module->name : '') . '/translations/' . $this->getRepresentation() . '.ini';
		
		// checks that folder exists
		if (file_exists($file)) {
			
			// scans file and gets translation strings
			$strings = parse_ini_file($file);
			return (is_array($strings) ? $strings : array());
			
		} else {
			
			return array();
			
		}
		
	}
596747
private static function parseDefinitions(array $definitions): array
    {
        if (\count($definitions) === 0) {
            return $definitions;
        }

        return \array_map(
            function ($definition) {
                if (\is_array($definition)) {
                    return $definition;
                }

                return self::loadDefinitionsFromPath($definition);
            },
            $definitions
        );
    }
461875
public function getIdByPath($module)
    {
        $moduleId = null;
        $moduleFile = $module;
        $moduleId = $this->getIdFromExtension($module);
        if (!$moduleId) {
            $modulePaths = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModulePaths');

            if (is_array($modulePaths)) {
                foreach ($modulePaths as $id => $path) {
                    if (strpos($moduleFile, $path . "/") === 0) {
                        $moduleId = $id;
                    }
                }
            }
        }
        if (!$moduleId) {
            $moduleId = substr($moduleFile, 0, strpos($moduleFile, "/"));
        }
        if (!$moduleId) {
            $moduleId = $moduleFile;
        }

        return $moduleId;
    }
507737
public static function getModule($module) {
        $info = null;
        if (isset (self::$modules [ $module ])) {
            return self::$modules [ $module ];
        }

        return $info;
    }
1115564
public function getConfig($module)
    {
        if (!isset($this->cache['paths'][$module])) {
            $path = $this->getPath($module);
            $file = $path.DIRECTORY_SEPARATOR.'slender.yml';
            $parsed = $this->parser->parseFile($file);
            $parsed['path'] = $path;
            $this->cache['paths'][$module] = $parsed;
        }

        return $this->cache['paths'][$module];
    }
865805
public function get_handled_file_types($module) {
        $types = array();
        foreach ($this->filehandlers as $handler) {
            if ($handler->module == $module) {
                if ($handler->extension == '*') {
                    return '*';
                } else {
                    // Prepending '.' as otherwise mimeinfo fails.
                    $types[] = '.'.$handler->extension;
                }
            }
        }
        return $types;
    }
749206
public function getPath($module)
    {
        foreach ($this->resolvers as $resolver) {
            $path = $resolver->getPath($module);
            if ($path !==false) {
                return $path;
            }
        }

        return false;
    }
271590
public function getModulePath($module)
    {
        try {
            return $this->findOrFail($module)->getPath() . '/';
        } catch (ModuleNotFoundException $e) {
            return $this->getPath() . '/' . Str::studly($module) . '/';
        }
    }