Returns the module with the given name.

@param string $name The module name.

@return Module The module with the passed name.

@throws NoSuchModuleException If the module was not found.
354133
public function get($name)
    {
        if (!isset($this->modules[$name])) {
            throw new NoSuchModuleException(sprintf(
                'The module "%s" was not found.',
                $name
            ));
        }

        return $this->modules[$name];
    }
1094276
protected function create($name) {
    $c = $this->avaibleModules[$name]['class'];
    $module = new $c($this->project, $this->inTests);
    $module->setName($name);
    
    $this->modules[$name] = $module;
    
    PSC::getEventManager()->dispatchEvent('Psc.ModuleCreated', NULL, $module);
    
    return $module;
  }
734271
protected static function _find_module($name = null)
	{
		$files = array();

		if ($name)
		{
			// find a module
			foreach (\Config::get('module_paths') as $m)
			{
				$found = new \GlobIterator($m.$name.DS.\Config::get('migrations.folder').'*_*.php');
				if (count($found))
				{
					foreach($found as $file)
					{
						$files[] = $file->getPathname();
					}
					break;
				}
			}
		}
		else
		{
			// find all modules
			foreach (\Config::get('module_paths') as $m)
			{
				$found = new \GlobIterator($m.'*'.DS.\Config::get('migrations.folder').'*_*.php');
				foreach($found as $file)
				{
					$files[] = $file->getPathname();
				}
			}
		}

		return $files;
	}
924663
public function getModule($name){
        if(isset($this->modules[$name])){
            return $this->modules[$name];
        }
        return NULL;
    }
522226
protected function fromPath($name)
    {
        $modules = [];

        $base = $this->getBase();
        $path = $this->getDir();

        if ($this->endsWith($name, '*')) {

            $dirs = $this->getDirs($base . $path, $name);

            foreach ($dirs as $name => $dir) {
                $modules[] = $this->makeFromPath($name, $path);
            }

        } else {
            $modules[] = $this->makeFromPath($name, $name);
        }

        return $modules;
    }
1250694
public static function ModulePath($name)
    {
        // BC for a couple fo the key modules in the old syntax. Reduces merge brittleness but can
        // be removed before 4.0 stable
        $legacyMapping = [
            'framework' => 'silverstripe/framework',
            'frameworkadmin' => 'silverstripe/admin',
        ];
        if (isset($legacyMapping[$name])) {
            $name = $legacyMapping[$name];
        }

        return ModuleLoader::getModule($name)->getRelativePath();
    }
1172709
public function find($name)
    {
        foreach ($this->all() as $module) {
            if ($module->getLowerName() === strtolower($name)) {
                return $module;
            }
        }

        return;
    }
934560
public function get($name)
    {
        if (isset($this->_loaded[$name])) {
            return $this->_loaded[$name];
        }

        return null;
    }
503435
public function findByName(string $name)
    {
        return $this->first(function(ExtensionContract $extension) use($name) {
            return $extension->getPackage()->getName() === $name;
        });
    }
562882
public function getModule($name){
        if($this->loadModules != 'ALL' && !in_array($name, $this->loadModules)){
            $this->connection->select('k.url, k.method');
            $this->connection->from($this->tableModule . ' m');
            $this->connection->join($this->tableKey . ' k', 'm.id = k.moduleId');
            $this->connection->where('m.name = :name', array('name' => $name));
            $module= $this->connection->get()->fetchAll(\PDO::FETCH_ASSOC);
            $this->modules[$name]= $module;
            $this->loadModules[]= $name;
        }
        return $this->modules[$name];
    }
220507
public function get($name)
    {
        $loader = $this->getLoader();
        $configurationKey = $loader->getConfigurationKey($name);
        $configuration = &static::$configurations[$configurationKey];
        if (!isset($configuration)) {
            $configuration = $loader->loadByKey($configurationKey);
        }

        return $configuration;
    }
772103
public static function connection($name = null)
    {
        self::$use = $name ? $name : self::$use;
        return self::get(self::$use);
    }
947471
public function get($name)
    {
        if (!isset($this->packages[$name])) {
            return null;
        }

        return $this->packages[$name];
    }
130541
public function installModule($name)
    {
        $return = [];
        if (!($module = CModule::CreateModuleObject($name))) {
            throw new Exception("Module {$name} not found");
        } elseif ($module->IsInstalled()) {
            throw new Exception("Module {$name} already installed");
        } else {
            $module->DoInstall();
            $return[] = "Module {$name} installed";
        }

        return $return;
    }
413903
public function getCommandConfig($name)
    {
        foreach ($this->commandConfigs as $commandConfig) {
            if ($name === $commandConfig->getName()) {
                return $commandConfig;
            }
        }

        throw NoSuchCommandException::forCommandName($name);
    }
1346291
public function getDesignModule($name)
    {
        foreach ($this->getDesignModules() as $module) {
            if ($module->getName() == $name) {
                return $module;
            }
        }

        return false;
    }
701407
public function getParameterValue($name)
    {
        if (!isset($this->parameterValues[$name])) {
            throw NoSuchParameterException::forParameterName($name, $this->installerName);
        }

        return $this->parameterValues[$name];
    }