Register a plugin
@param DynamicModule $module the plugin to register
@return boolean true if registered
512838
public function register(DynamicModule $module)
    {
        if(!is_null($module) && ! empty($module->getModule()) ) {

            self::getRegistry()->set($module->getModule(), $module->toArray());

            return true;
        }
        return false;
    }
879839
public function registerModules(string $filePath = null)
    {
        is_file($filePath) || $filePath = App::getBasePath() . $filePath;

        if (is_file($filePath)) {
            /** @var Registry $modules */

            /** @noinspection PhpIncludeInspection */
            $modules = require_once $filePath;

            $modules = is_array($modules) ? $modules : [];

            foreach ($modules as $module) {
                IOC::resolve('Modules')->register($module);
            }

            Event::dispatch('minimal.loaded.modules', [$filePath, $modules]);
        }
    }
453264
public function setModule($name, $module, $parameters = null)
    {
        $name = strtolower($name);

        if (class_exists($module, true)) {

            /**
             * instantiation and initialization of
             * each module, return true on success
             * and false on error
             */
            $instance = new $module($parameters);
            $this->registerModule($name, $instance);
        }
        return $this;
    }
239821
function register(Module, selector) {
  const _selector = getSelector(Module, selector);

  validate(Module, _selector);

  const methods = OdoModuleMethods(Module, _selector);

  // Apply OdoModule static methods.
  Object.keys(methods).forEach((method) => {
    Module[method] = methods[method];
  });

  // Apply the OdoModule static property.
  Module.Instances = new Map();

  // Internally register the module.
  store.set(_selector, Module);

  return Module;
}
259147
public function isModuleCurrent(string $module): bool
	{
		return strpos($this->getAction(true), $module) !== false;
	}
317366
public function registerModulePath($moduleName, $path, $addPrefix = true)
    {
        $normalized = static::normalizePath($path) . PHP_DS;
        if ($addPrefix) {
            $normalized .= static::DEFAULT_PREFIX . PHP_DS;
        }
        $this->modulesMap[static::normalizeModule($moduleName)] = $normalized;

        return $this;
    }
283730
public void addModule(Module module) {
		if (module instanceof HttpAdapterAware) {
			((HttpAdapterAware) module).setHttpAdapter(getHttpAdapter());
		}
		this.moduleRegistry.addModule(module);
	}
1029561
private function registerVendorConfig(Module $module)
    {
        $files = $this->app['files']->files($module->getPath().'/Config/Vendor');

        foreach ($files as $file) {
            $filename = preg_replace('/\\.[^.\\s]{3,4}$/', '', basename($file));

            $this->mergeConfigFrom(
                $file,
                $filename
            );
        }
    }
952378
public static function registerModule(string $name): void
    {
        if (!isset(static::$registeredModules[$name])) {
            $modulePath = static::getModulePath($name);

            static::prependIncludePath($modulePath . 'controllers', $modulePath . 'library');
            static::$registeredModules[$name] = true;
            $initPath = $modulePath . 'init.php';

            if (is_file($initPath)) {
                require $initPath;
            }
        }
    }
836821
public function add(Module $module)
    {
        $this->modules[$module->getName()] = $module;

        if ($module instanceof RootModule) {
            $this->rootModule = $module;
        }
    }
405322
def register_plugin_module(mod):
    """"""
    for k, v in load_plugins_from_module(mod).items():
        if k:
            if isinstance(k, (list, tuple)):
                k = k[0]
            global_registry[k] = v
701738
public function addModule($module) {
        $this->registerModule($module);
        if (is_object($module)) $module = $module->name;
        $this->userModules[] = $module;
    }
1325710
public function addModule($module, array $options = NULL) {
		$this->add_to_list($module, new $module($this->server, $this, $options));
    }
573507
protected function registerLanguageNamespace(Module $module)
    {
        $moduleName = $module->getName();

        $langPath = base_path("resources/lang/modules/$moduleName");

        if (is_dir($langPath)) {
            $this->loadTranslationsFrom($langPath, $moduleName);
            $this->app['localization.js-generator']->addSourcePath($langPath, $moduleName);
        } else {
            $this->loadTranslationsFrom($module->getPath().'/Resources/lang', $moduleName);
            $this->app['localization.js-generator']->addSourcePath($module->getPath().'/Resources/lang', $moduleName);
        }
    }
1076479
protected function unregisterModule($moduleName, $hook)
    {
        if (!in_array($hook, array_keys($this->modules))) {
            return false;
        }
        if (array_key_exists($moduleName, $this->modules[$hook])) {
            unset($this->modules[$hook][$moduleName]);
            return true;
        }
        return false;
    }
1038913
function registerModules() {
    // Dynamic module loading is no longer supported for simplicity.
    // Module is free to load any of its resources dynamically.
    // Or an extension can provide dynamic module loading capabilities as needed.
    if (_scalejs2.default.isApplicationRunning()) {
        throw new Error('Can\'t register module since the application is already running.', 'Dynamic module loading is not supported.');
    }

    Array.prototype.push.apply(moduleRegistrations, toArray(arguments).filter(function (m) {
        return m;
    }));
}
838386
protected function registerModule($moduleName)
    {
        $module = new ModuleModel;
        $module->module_name = $this->def($moduleName, 'name');
        $module->module_version = $this->def($moduleName, 'version');
        $module->module_status = 0;
        $module->module_is_enabled = 0;
        $module->module_is_installed = 1;
        $module->save();

        return true;
    }