{@inheritDoc}

@param string $name Module name
8520
public function main(string $name = '') : void
    {
        parent::main();

        $name = $this->_camelize($name);

        $this->validate($name, (string)Configure::read('CsvMigrations.modules.path'));

        $this->bakeModuleConfig($name);
        $this->bakeDatabaseConfig($name);
        $this->bakeViewsConfig($name);
        $this->bakeController($name);
        $this->bakeApiController($name);
        $this->bakeTable($name);
        $this->bakeEntity($name);
        $this->bakeFeature($name);
    }
1072189
public function get_module( string $name ) {
		return true === isset( $this->_modules[ $name ] ) ? $this->_modules[ $name ] : null;
	}
1168658
public function unloadModule($name)
    {
        $this->log(SMARTIRC_DEBUG_MODULES, 'DEBUG_MODULES: unloading module: '
            ."$name...", __FILE__, __LINE__
        );

        if (isset($this->_modules[$name])) {
            if (in_array('module_exit',
                    get_class_methods(get_class($this->_modules[$name]))
            )) {
                $this->_modules[$name]->module_exit($this);
            }

            unset($this->_modules[$name]);
            $this->log(SMARTIRC_DEBUG_MODULES, 'DEBUG_MODULES: successfully'
                ." unloaded module: $name", __FILE__, __LINE__);
            return $this;
        }

        $this->log(SMARTIRC_DEBUG_MODULES, "DEBUG_MODULES: couldn't unload"
            ." module: $name (it's not loaded!)", __FILE__, __LINE__
        );
        return false;
    }
179811
public function middleware($name)
    {
        if (is_string($name)) {
            app()->addRouteMiddleware($name);
        } else if (is_array($name)) {
            foreach ($name as $middlewareName) {
                app()->addRouteMiddleware($middlewareName);
            }
        }
    }
389536
public function installed( $name )
	{
		if( ! is_array($name) )
		{
			$name = [$name];
		}

		if( ! count($name) )
		{
			return false;
		}

		foreach( $name as $module_name )
		{
			if( is_numeric($module_name) )
			{
				if( !$this->offsetExists($module_name) )
				{
					return false;
				}
			}
			else if( $this->getId($module_name) === false )
			{
				return false;
			}
		}

		return true;
	}
631976
public function get($name)
    {
        return isset($this->modules[$name]) ? $this->modules[$name] : null;
    }
1308228
public function moduleEnabled($name) {
    $this->options[] = '--format=json';
    $modules = $this->__call('pmList', []);
    if (!$modules = json_decode($modules, TRUE)) {
      throw new DrushFormatException("Cannot parse json output from drush: $modules", $modules);
    }
    $this->options = [];
    return isset($modules[$name]) && $modules[$name]['status'] === 'Enabled';
  }
1012625
private function loadLanguageFile($name)
    {
        /** @var System $system */
        $system = $this->framework->getAdapter(System::class);
        $system->loadLanguageFile($name);
    }
893041
public function isEnabled($name)
    {
        foreach ($this->modules as $module) {
            if ($name === $module->title) {
                return true;
            }
        }
        return false;
    }
784640
public function import($name)
    {
        $object = null;
        if (!isset($this->modules[$name])) {
            if (isset($this->moduleMap[$name])) {
                $object_class = $this->moduleMap[$name];
                $object = new $object_class();
                $object->setSystem($this);
                $object->setEventLoop($this->eventLoop);
                $this->modules[$name] = $object;
            }
        }
        else{
            $object = $this->modules[$name]; 
        }

        return $object;

    }
292856
public function remove($module, $name)
    {
        $this->initializeOnDemand();

        if ($this->exists($module, $name) && $this->configMapper->delete($module, $name)) {
            $this->arrayConfig->remove($module, $name);
            return true;

        } else {
            return false;
        }
    }
1341410
protected function loadThemedJS($name)
    {
        if ($this->isDevServerActive()) {
            Requirements::javascript($this->getDevServerURL($this->ext($name, 'js')));
        } else {
            Requirements::themedJavascript($name);
        }
    }
429281
private function bakeModuleConfig(string $name) : void
    {
        $options = [
            'path' => Configure::read('CsvMigrations.modules.path') . $name . DS . 'config' . DS,
            'ext' => 'json'
        ];

        $this->bake('config.dist', 'Module/config/config', [], '', $options);
        $this->bake('fields.dist', 'Module/config/fields', [], '', $options);
        $this->bake(
            'menus.dist',
            'Module/config/menus',
            ['label' => Inflector::humanize($name), 'url' => DS . Inflector::dasherize($name) . DS],
            '',
            $options
        );
    }
195211
public function getModule($name)
    {
        if ($this->isLoaded($name)) {
            return $this->loaded[$name];
        } else {
            return $this->loadModuleByName($name);
        }
    }
199482
public function disable($name)
    {
        $enabled = $this->getEnabled();

        if (($k = array_search($name, $enabled)) === false) {
            return;
        }

        $extension = $this->getExtension($name);

        $this->dispatcher->dispatch(new Disabling($extension));

        unset($enabled[$k]);

        $this->setEnabled($enabled);

        $extension->disable($this->app);

        $this->dispatcher->dispatch(new Disabled($extension));
    }
924663
public function getModule($name){
        if(isset($this->modules[$name])){
            return $this->modules[$name];
        }
        return NULL;
    }
1173029
public function setModule($name, $module=null)
	{
	    if (!$module) {
	        $module = $name;
	    }
	    
	    if ($module instanceof Module) {
	        $name  = $module->getName();
	        $alias = $module->alias;
	    } else {
	        if (is_string($module)) {
	            $module = ['basePath' => $module];
	        } elseif (is_array($module)) {
	            if (!isset($module['basePath'])) {
	                $module['basePath'] = $name;
	            }
	        } else {
	            throw new InvalidArgumentException('modules config must be array.');
	        }
	        
	        if (strpos($module['basePath'], $this->basePath) === false) {
	            $module['basePath'] = rtrim($this->basePath, '/\\') . '/' . trim($module['basePath'], '/\\') . '/';
	        }
	        $module['class'] = '\\Wslim\\Common\\Module';
	        
	        if (is_numeric($name)) {
	            $name = str_replace($this->basePath, '', $module['basePath']);
	        }
	        $name = trim($name, '\\/');
	        $module['name'] = $name;
	        $alias = isset($module['alias']) ? $module['alias'] : null;
	    }
	    
		if (!isset($this->_modules)) {
		    $this->_modules = [];
		}
		
		if ($alias) {
		    $this->_moduleAliases[$alias] = $name;
		}
		
		if (!in_array($name, $this->_modules)) {
		    array_push($this->_modules, $name);
		    $uid = 'module.' . $name;
            $this->set($uid, $module);
		}
		
		return $this;
	}