Add module files

@param string $sModuleId Module id
431667
protected function _deleteModuleFiles($sModuleId)
    {
        $aFiles = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleFiles');
        unset($aFiles[$sModuleId]);

        $this->_saveToConfig('aModuleFiles', $aFiles);
    }
849410
public function installModule($plugin_id)
	{
		$moduleVendorPath = Yii::getPathOfAlias('application.vendor.ommu');
		$module = OmmuPlugins::model()->findByPk($plugin_id);

		if($module != null) {
			$moduleName = $module->folder;
			if($model->parent_id != 0)
				$moduleName = $module->parent->folder;
			
			if($model->install == 1) {
				$config = $this->getModuleConfig($moduleName);
				if($config) {
					$tableName = $config['db_table_name'];
					$fileName  = trim($config['db_sql_filename']);
					$sqlFile = $moduleVendorPath.'/'.$moduleName.'/data/'.$fileName;
	
					if($tableName && !empty($tableName) && $fileName != '' && file_exists($sqlFile)) {
						$tables  = Yii::app()->db->createCommand('SHOW FULL TABLES WHERE table_type = "BASE TABLE"')->queryColumn();
	
						if(!in_array($tableName[0], $tables)) {
							$sql = file_get_contents($sqlFile);
							Yii::app()->db->createCommand($sql)->execute();
						}
					}
				}

			} else
				$this->deleteModuleDatabase($moduleName);

		} else
			return false;
	}
636276
protected function _deleteModule($sModuleId)
    {
        $aExt = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesWithExtendedClass();

        $aUpdatedExt = $this->diffModuleArrays($aExt, $sModuleId);
        $aUpdatedExt = $this->buildModuleChains($aUpdatedExt);

        \OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar('aarr', 'aModules', $aUpdatedExt);
    }
47023
protected function prefixModuleName($moduleId)
    {
        $module = $this->data->rawData['modules'][ $moduleId ];

        if ($this->prefixSection) {

            $this->data->rawData['modules'][ $moduleId ]['prefixed_name'] =
                $this->addPrefix(
                    array_get($module, 'prefixed_name') ?: $module['name'],
                    $module['parent_names']['section']
                );
        }

        if ($this->prefixGroup) {

            $this->data->rawData['modules'][ $moduleId ]['prefixed_name'] =
                $this->addPrefix(
                    array_get($module, 'prefixed_name') ?: $module['name'],
                    $module['parent_names']['group']
                );
        }

        if ($this->prefixMenu) {

            $this->data->rawData['modules'][ $moduleId ]['prefixed_name'] =
                $this->addPrefix(
                    array_get($module, 'prefixed_name') ?: $module['name'],
                    $module['parent_names']['menu']
                );
        }
    }
127261
public function addModule(string $moduleName)
    {
        $this->modules[$moduleName] = new \BFW\Module($moduleName);
        $this->modules[$moduleName]->loadModule();
    }
1167229
public static function Append($sName, $sDirectory){
            $oThis = self::CreateInstanceIfNotExists();
            
            if(array_key_exists($sName, $oThis->aModules)){
                return $oThis->aModules[$sName];
            }
            else{
                $oModule = new Module($sName, $sDirectory);
                $oThis->aModules[$sName] = $oModule;
                return $oModule;
            }
        }
1197
private function addModuleRules()
	{
		// Load the routes from cache
		$moduleRoutes = array();
		$directories = glob(Yii::getPathOfAlias('application.modules') . '/*' , GLOB_ONLYDIR);

		foreach ($directories as $dir)
		{
			$routePath = $dir .DS. 'config' .DS. 'routes.php';
			if (file_exists($routePath))
			{
				$routes = require_once($routePath);
				// Unit tests are failing here for some reason
				if (!is_array($routes))
					continue;

				foreach ($routes as $k=>$v)
				$moduleRoutes[$k] = $v;
			}
		}

		return $moduleRoutes;
	}
1070683
public function add($moduleId, $controllers)
    {
        $controllerMap = $this->get();
        $controllerMap[$moduleId] = $controllers;

        $this->set($controllerMap);
    }
90864
protected function _addModuleVersion($sModuleVersion, $sModuleId)
    {
        $aVersions = (array) $this->getConfig()->getConfigParam('aModuleVersions');
        $old =  isset($aVersions[$sModuleId]) ? $aVersions[$sModuleId] : '';
        if (is_array($aVersions)) {
            $aVersions[$sModuleId] = $sModuleVersion;
            if ($old !== $sModuleVersion) {
                $this->output->writeLn("$sModuleId fixing module version from $old to $sModuleVersion");
                $aEvents[$sModuleId] = $sModuleVersion;
                $this->_saveToConfig('aModuleVersions', $aVersions);
                $this->needCacheClear = true;
            }
        } else {
            if ($old) {
                $this->output->writeLn("$sModuleId unregister module version");
                $this->_deleteModuleVersions($sModuleId);
                $this->needCacheClear = true;
            }
        }

    }
150106
function setModulesDir($modulesDir)
    {
        if (is_string($modulesDir))
            $modulesDir = array($modulesDir);

        $this->modulesDir = array_merge($this->modulesDir, $modulesDir);
        return $this;
    }
726057
protected function filterExtensionsByModuleId($modules, $moduleId)
    {
        $modulePaths = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModulePaths');

        $path = '';
        if (isset($modulePaths[$moduleId])) {
            $path = $modulePaths[$moduleId] . '/';
        }

        // TODO: This condition should be removed. Need to check integration tests.
        if (!$path) {
            $path = $moduleId . "/";
        }

        $filteredModules = [];
        foreach ($modules as $class => $extend) {
            foreach ($extend as $extendPath) {
                if (strpos($extendPath, $path) === 0) {
                    $filteredModules[$class][] = $extendPath;
                }
            }
        }

        return $filteredModules;
    }
884488
protected function _addModuleVersion($sModuleVersion, $sModuleId)
    {
        $aVersions = (array) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aModuleVersions');
        if (is_array($aVersions)) {
            $aVersions[$sModuleId] = $sModuleVersion;
        }

        $this->_saveToConfig('aModuleVersions', $aVersions);
    }
221825
public function addModule(ModuleInterface ...$modules): ApplicationBuilder
    {
        foreach ($modules as $module) {
            $this->modules[] = $module;
        }

        return $this;
    }
1209455
public function getModuleFullPath(string $moduleId) : string
    {
        $modulePaths = Registry::getConfig()->getConfigParam('aModulePaths');

        /**
         * @TODO We have to throw an exception here in the future, module path should exist.
         *       Use module id for the BC.
         */
        $moduleRelativePath = $modulePaths[$moduleId] ?? $moduleId;

        return Registry::getConfig()->getModulesDir() . $moduleRelativePath;
    }
283205
public T addModule(final String moduleName, final String slot, final byte[] newHash) {
        final ContentItem item = createModuleItem(moduleName, slot, newHash);
        addContentModification(createContentModification(item, ModificationType.ADD, NO_CONTENT));
        return returnThis();
    }
862600
public function initModules(IModulesLoader $modulesLoader)
    {
        foreach ($modulesLoader->getModules() as $module) {
            $this->addModule($module);
        }
    }
1080420
protected function add_feedback_files(int $historyid = null) {
        global $CFG;

        // We only support feedback files for modules atm.
        if ($this->grade_item && $this->grade_item->is_external_item()) {
            $context = $this->get_context();
            $this->copy_feedback_files($context, GRADE_FEEDBACK_FILEAREA, $this->id);

            if (empty($CFG->disablegradehistory) && $historyid) {
                $this->copy_feedback_files($context, GRADE_HISTORY_FEEDBACK_FILEAREA, $historyid);
            }
        }

        return $this->id;
    }