Un-install a module
@param string $module_id
@return mixed
172592
public function uninstall($module_id)
    {
        try {
            $result = $this->canUninstall($module_id);
        } catch (Exception $ex) {
            $result = $ex->getMessage();
        }

        $this->hook->attach("module.uninstall.before|$module_id", $result, $this);

        if ($result !== true) {
            return $result;
        }

        $this->module->delete($module_id);
        $this->setOverrideConfig();

        $this->hook->attach("module.uninstall.after|$module_id", $result, $this);
        return $result;
    }
503462
public function uninstall($moduleName)
    {
        $module = $this->findOrFalse('module_name', $moduleName);
        if ($module)
        {
            $version = $this->def($moduleName, 'version');
            if ($this->checkModuleDepends($moduleName, new Version($version)))
                return false;

            $this->app['events']->fire('modules.uninstall.'.$moduleName, null);

            $module->delete();

            if (!$this->removeAssets($moduleName))
                $this->errors->add('delete_assets', "Unable to delete assets $moduleName");

            if (!$this->removeModuleDirectory($moduleName))
                $this->errors->add('delete_module', "Unable to delete $moduleName");

            return true;
        }
        return false;
    }
1229552
def module_remove(name):
    '''
    
    '''
    ret = {'name': name,
           'result': True,
           'comment': '',
           'changes': {}}
    modules = __salt__['selinux.list_semod']()
    if name not in modules:
        ret['comment'] = 'Module {0} is not available'.format(name)
        ret['result'] = False
        return ret
    if __salt__['selinux.remove_semod'](name):
        ret['comment'] = 'Module {0} has been removed'.format(name)
        return ret
    ret['result'] = False
    ret['comment'] = 'Failed to remove module {0}'.format(name)
    return ret
1160950
def remove(name):
    '''
    
    '''
    # Putting quotes around the parameter protects against command injection
    cmd = 'Uninstall-Module "{0}"'.format(name)
    no_ret = _pshell(cmd)
    return name not in list_modules()
478897
protected function checkDependenciesModule($module_id)
    {
        $modules = $this->module->getList();
        $validated = $this->validateDependencies($modules, true);

        if (empty($validated[$module_id]['errors'])) {
            return true;
        }

        $messages = array();
        foreach ($validated[$module_id]['errors'] as $error) {
            list($text, $arguments) = $error;
            $messages[] = $this->translation->text($text, $arguments);
        }

        throw new UnexpectedValueException(implode('<br>', $messages));
    }
246323
public function disable(Module $module, bool $recollect = true, bool $recursive = false): bool
    {
        $action = function (Module $module) {
            $installer = $module->installer();
            if ($installer === null) {
                return true;
            }

            if (!class_exists($installer) || !is_subclass_of($installer, Installer::class, true)) {
                return false;
            }

            /** @var Installer $installer */
            $installer = new $installer($module);
            try {
                $installer->disable();
                return true;
            } catch (Throwable $e) {
                $installer->disableError($e);
                return false;
            }
        };

        $callback = function (Module $module) use ($recollect) {
            $this->notify($module, 'enabled', false);

            if ($recollect) {
                $this->getCollector()->recollect();
            }

            $this->emit('module.disabled.' . $module->name());
        };

        $manager = $this->moduleManager();

        if ($recursive) {
            foreach ($manager->recursiveDependants($module) as $dependant) {
                if ($dependant->isEnabled()) {
                    if (!$manager->disable($dependant, $action, $callback)) {
                        return false;
                    }
                }
                if ($dependant->isInstalled()) {
                    if (!$this->uninstall($dependant, $recollect, false)) {
                        return false;
                    }
                }
            }
        }

        return $manager->disable($module, $action, $callback);
    }
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;
    }
1296711
public function invalidateModuleCache(string $moduleId)
    {
        /**
         * @TODO we have to implement it in ShopModuleCacheService or use ModuleCache::resetCache() method.
         */
        $module = oxNew(Module::class);

        $templates = $module->getTemplates($moduleId);
        $utils = Registry::getUtils();
        $utils->resetTemplateCache($templates);
        $utils->resetLanguageCache();
        $utils->resetMenuCache();

        ModuleVariablesLocator::resetModuleVariables();

        if (extension_loaded('apc') && ini_get('apc.enabled')) {
            apc_clear_cache();
        }
    }
990222
public function disableModule($modulePath)
    {
        $module = oxNew(\OxidEsales\Eshop\Core\Module\Module::class);
        $moduleId = $module->getIdByPath($modulePath);
        $module->load($moduleId);

        $moduleCache = oxNew('oxModuleCache', $module);
        $moduleInstaller = oxNew('oxModuleInstaller', $moduleCache);

        return $moduleInstaller->deactivate($module);
    }
226200
public function uninstall($id, $type)
    {
        $installer = $this->getInstaller();

        return $installer->uninstall($type, $id);
    }
351926
public function uninstallModule($name)
    {
        $return = [];
        if (!($module = CModule::CreateModuleObject($name))) {
            throw new Exception("Module {$name} not found");
        } elseif (!$module->IsInstalled()) {
            throw new Exception("Module {$name} already uninstalled");
        } else {
            $module->DoUninstall();
            $return[] = "Module {$name} uninstalled";
        }

        return $return;
    }
711213
function(id) {
        var plugin_dir = path.join(plugins_dir, id);
        if ( !fs.existsSync(plugin_dir) ) {
            events.emit('verbose', 'Plugin "'+ id +'" already removed ('+ plugin_dir +')');
            return Q();
        }
        
        shell.rm('-rf', plugin_dir);
        events.emit('verbose', 'Deleted "'+ id +'"');
        
        if(options.fetch) {
            //remove plugin from node_modules directory
            return npmUninstall(id, options.projectRoot, options); 
        }
        
        return Q();

    }
178106
public function getModuleSettings($module_id, $key = null, $default = null)
    {
        return $this->module->getSettings($module_id, $key, $default);
    }
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;
    }
735171
private static function get_all_licenses( $module_id = null ) {
            $licenses = self::get_account_option( 'all_licenses' );

            if ( ! is_array( $licenses ) ) {
                $licenses = array();
            }

            if ( is_null( $module_id ) ) {
                return $licenses;
            }

            $licenses = isset( $licenses[ $module_id ] ) ?
                $licenses[ $module_id ] :
                array();

            return $licenses;
        }
112265
public function uninstall()
    {
        /*
         * Rollback plugins
         */
        $plugins = $this->pluginManager->getPlugins();
        foreach ($plugins as $name => $plugin) {
            $this->rollbackPlugin($name);
        }

        /*
         * Register module migration files
         */
        $paths = [];
        $modules = Config::get('cms.loadModules', []);

        foreach ($modules as $module) {
            $paths[] = $path = base_path() . '/modules/'.strtolower($module).'/database/migrations';
        }

        /*
         * Rollback modules
         */
        while (true) {
            $rolledBack = $this->migrator->rollback($paths, ['pretend' => false]);

            foreach ($this->migrator->getNotes() as $note) {
                $this->note($note);
            }

            if (count($rolledBack) == 0) {
                break;
            }
        }

        Schema::dropIfExists($this->getMigrationTableName());

        return $this;
    }
787672
public function install($module_id, $status = true)
    {
        gplcart_static_clear();

        try {
            $result = $this->canInstall($module_id);
        } catch (Exception $ex) {
            $result = $ex->getMessage();
        }

        $this->hook->attach("module.install.before|$module_id", $result, $this);

        if ($result !== true) {
            $this->module->delete($module_id);
            return $result;
        }

        $this->module->add(array('module_id' => $module_id, 'status' => $status));
        $this->setOverrideConfig();

        $this->hook->attach("module.install.after|$module_id", $result, $this);
        return $result;
    }