Registers a previewer adapter
@param DynamicModule $module the plugin to register
@return boolean true if registered
502609
public function registerAdapter(DynamicModule $module)
    {
        if(!is_null($module) && ! empty($module->getModule()) ) {

            $registry = $this->getRegistry();
            $config = [];
            if ($registry->isRegistered(self::REGISTRY_ENTRY_KEY)) {
                $config = $registry->get(self::REGISTRY_ENTRY_KEY);
            }

            $config[self::PREVIEWERS_KEY][$module->getModule()] = $module->toArray();
            $registry->set(self::REGISTRY_ENTRY_KEY, $config);
            return true;
        }
        return false;
    }
363795
protected function _prepareArrayModule(array &$module, &$moduleObject = false)
    {
        $moduleName = key($module);
        $module     = $module[$moduleName];

        if (is_object($module))
            $moduleObject = $module;
        
        # we want to register module name on event only if instance object resolved
        $module = $moduleName;
    }
836821
public function add(Module $module)
    {
        $this->modules[$module->getName()] = $module;

        if ($module instanceof RootModule) {
            $this->rootModule = $module;
        }
    }
210069
protected function registerAdapterPlugger()
    {
        $this->app->bind('adapter.plugger', function ($app) {
            $collection = new Collection;

            return new AdapterPlugger($collection, $app['config']);
        });

        $this->app->alias('adapter.plugger', AdapterPlugger::class);
    }
1149522
protected function registerViewNamespace(Module $module)
    {
        $this->app['view']->addNamespace(
            $module->getName(),
            $module->getPath().'/Resources/views'
        );
    }
593555
public function deleteModuleDb($module)
	{
		if($module != null) {
			$model = OmmuPlugins::model()->findByAttributes(array('folder'=>$module));
			
			if($model != null)
				$model->delete();

			else 
				return true;

		} else 
			return true;
	}
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;
    }
664817
public function registerTypeDataModule(ITypeDataModule $module)
    {
        $this->typeDataModules[] = $module;
        foreach ($module->functions() as $name => $returnType) {
            $normalizedFunctionName                         = $this->normalizeFunctionName($name);
            $this->functionTypeMap[$normalizedFunctionName] = $returnType;
            unset($this->functions[$normalizedFunctionName]);
        }

        foreach ($module->types() as $name => $typeData) {
            $normalizedClassName                      = $this->normalizeClassName($name);
            $this->classTypeMap[$normalizedClassName] = $typeData;
            unset($this->objectTypes[$normalizedClassName]);
        }
    }
1129997
public static function isDebugModeEnabled(Module $module)
    {
        return Craft::$app->getConfig()->getGeneral()->devMode ||
            ($module instanceof LoggableInterface && $module->isDebugModeEnabled());
    }
711237
protected function registerModule($moduleName, \OtherCode\Rest\Modules\BaseModule $moduleInstance, $hook)
    {
        if (!in_array($hook, array_keys($this->modules))) {
            return false;
        }
        if (!array_key_exists($moduleName, $this->modules[$hook])) {
            $this->modules[$hook][$moduleName] = $moduleInstance;
            return true;
        }
        return false;
    }
169126
public function hasModule($module)
    {
        return $module instanceof ModuleInterface
            ? in_array($module, $this->modules)
            : isset($this->modules[$module]);
    }
1083983
public static function setCurrentModule(string $module): void
    {
        if (static::$currentModule !== null) {
            $currentModule = static::$currentModule;
            throw new ApplicationException("Current module was already set to {$currentModule}; once current module is set, you can't change it");
        }

        static::$currentModule = $module;

        // register current module & run init.php if present
        static::registerModule($module);
    }
289926
public function isCoreModule($module)
    {
        if (!is_string($module)) {
            throw new InvalidArgumentException(sprintf(
                'Module name must be a string, not "%s"', gettype($module)
            ));
        }

        return in_array($module, $this->coreModules);
    }
1161513
private function registerConfigNamespace(Module $module)
    {
        $files = $this->app['files']->files($module->getPath().'/Config');

        $package = $module->getName();

        foreach ($files as $file) {
            $filename = $this->getConfigFilename($file, $package);

            $this->mergeConfigFrom(
                $file,
                $filename
            );
        }
    }
1062273
public function registerDefault($module)
    {
        $name = studly_case($module->getName());
        $class = 'Modules\\'.$name.'\\Installer\\RegisterDefaultPermissions';

        if (! class_exists($class)) {
            return false;
        }

        $registerDefaultPermissions = $this->container->make($class);

        if (! property_exists($registerDefaultPermissions, 'defaultPermissions')) {
            return false;
        }

        foreach ($registerDefaultPermissions->defaultPermissions as $permissionName => $permissionOption) {
            $this->registerPermission(
                "{$module->getLowerName()}::$permissionName",
                $permissionOption['display_name'],
                $permissionOption['description'],
                $module->getLowerName()
            );
        }

        return true;
    }
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);
        }
    }
259147
public function isModuleCurrent(string $module): bool
	{
		return strpos($this->getAction(true), $module) !== false;
	}