We deactivate the plugin and reset the configuration

@param string $configClass
The name of the plugin.
5752
public static function deactivatePlugin($configClass)
    {
        if (static::$plugins[$configClass][static::IS_ACTIVE] !== true) {
            // We will not purge everything for a already deactivated plugin.
            return;
        }

        // Purge all settings in the underlying registration class.
        static::$logFolder = '';
        static::$chunkFolder = '';
        static::$configFile = '';
        static::$blacklistDebugMethods = array();
        static::$blacklistDebugClass = array();
        static::$additionalHelpFiles = array();
        static::$eventList = array();
        static::$rewriteList = array();
        static::$additionalSkinList = array();

        // Go through the remaining plugins.
        static::$plugins[$configClass][static::IS_ACTIVE] = false;
        foreach (static::$plugins as $pluginName => $plugin) {
            if ($plugin[static::IS_ACTIVE]) {
                call_user_func(array(static::$plugins[$pluginName][static::CONFIG_CLASS], 'exec'));
            }
        }

        // Renew the configuration class, so the new one will load all settings
        // from the registration class.
        if (isset(Krexx::$pool)) {
            Krexx::$pool->rewrite = static::$rewriteList;
            Krexx::$pool->eventService->register = static::$eventList;
            Krexx::$pool->config = Krexx::$pool->createClass('Brainworxx\\Krexx\\Service\\Config\\Config');
            Krexx::$pool->messages->readHelpTexts();
        }
    }
1083508
protected static function override(&$class)
    {
        $map = gplcart_config_get(GC_FILE_CONFIG_COMPILED_OVERRIDE);

        if (isset($map[$class])) {
            $override = end($map[$class]);
            $class = $override;
        }

        return $class;
    }
365281
public function removeClass($class)
    {
        $classes = $this->get('class');
        if ($classes) {
            $classes = trim(preg_replace('/(^| ){1}' . $class . '( |$){1}/i', ' ', $classes));
            $this->set('class', $classes);
        }

        return $this;
    }
1133541
public function deactivate() {
		if ( ! $this->isValid() && Configs::get( 'licenseActivate' ) ) {
			delete_site_transient( $this->getKey() );
			deactivate_plugins( Configs::get( 'file' ) );
		}
	}
1063084
public function unloadPlugin($plugin)
    {
        $this->resetTransientCache();

        if (!($plugin instanceof Plugin)) {
            $oPlugin = $this->loadPlugin($plugin);
            if ($oPlugin === null) {
                unset($this->loadedPlugins[$plugin]);
                return;
            }

            $plugin = $oPlugin;
        }

        unset($this->loadedPlugins[$plugin->getPluginName()]);
    }
1213305
public static function findClassFromConfig(&$config, bool $removeClass = false)
    {
        // Normalize the config
        if (is_string($config)) {
            // Set as class
            $class = $config;

            // Clear class from config
            $config = '';
        } elseif (is_object($config)) {
            return get_class($config);
        } else {
            // Force Array
            if (!is_array($config)) {
                $config = ArrayHelper::toArray($config, [], false);
            }

            if ($removeClass) {
                if (!$class = ArrayHelper::remove($config, 'class')) {
                    $class = ArrayHelper::remove($config, 'type');
                }
            } else {
                $class = ArrayHelper::getValue(
                    $config,
                    'class',
                    ArrayHelper::getValue($config, 'type')
                );
            }
        }

        return $class;
    }
211900
public function removeClass($class)
    {
        $index = array_search((string) $class, $this->class);
        if ($index !== false) {
            unset($this->class[$index]);
        }
        return $this;
    }
547674
protected void unsetConfigAdmin(ConfigurationAdmin configAdmin) {
        SibTr.entry(tc, CLASS_NAME + "unsetConfigAdmin", configAdmin);

        SibTr.exit(tc, CLASS_NAME + "unsetConfigAdmin");
    }
705770
public function remove($class, $method)
    {
        $callback = $class . '::' . $method;
        if (isset($this->configs['instances'][$callback])) {
            unset($this->configs['instances'][$callback], $this->configs['log'][$callback]);
            App::$Properties->writeConfig('Cron', $this->configs);
        }
    }
1306382
private function onConfigLoaded()
    {
        $this->log('controller config loaded/updated');
        $this->stopPlugins();
        if (!$this->state['config']['enabled']) {
            $this->log('controller disabled');
            return;
        }

        foreach ($this->state['config']['plugins'] as $pluginId => $config) {
            if (!$config['enabled']) {
                continue;
            }

            $this->log('loading plugin '.$pluginId);

            foreach ($this->registeredPlugins as $className) {
                if ($className::getPluginId() == $pluginId) {
                    $plugin = new $className($this);
                    $this->plugins[] = $plugin;
                    $plugin->init();
                    continue 2;
                }
            }

            $this->log("plugin ${pluginId} is not registered with the controller");
        }
    }
903716
protected function loadPluginConfiguration(string $configPath)
    {
        $this->app->loadConfigurationFiles($this->config, $this->dirPath.'/'.trim($configPath, '\/'));
    }
235296
public function onConfigUpdated()
    {
        if ($this->client) {
            $this->client->config = $this->config;
            $this->client->onConfigUpdated();
        }
    }
1222181
public function initConfiguration(Configuration $configuration = null)
    {
        if (isset($configuration)) {
            $this->configuration = $configuration;
        }

        if (isset($this->configuration)) {
            $this->setLogger($this->configuration->getLogger());
            $this->componentFactory = null;
            $this->prepareFactory();
        }
    }
753818
public function removeClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (in_array($class, $classes)) {
                $classes = array_diff($classes, [$class]);
            }

            if (empty($classes)) {
                unset($this->attr['class']);
            } else {
                $this->attr['class'] = implode(' ', $classes);
            }
        }
    }
1229302
final public static function clearInstance($className)
  {
    if (isset(self::$_instances[$className])) {
      $name = self::_configName($className);
      Config::clearInstance($name);

      self::$_instances[$className]->_loadObservers();
    }
  }
949322
private static function bootClass()
    {
        if (!array_key_exists(static::class, self::$meta)) {
            self::$meta[static::class] = (new \ReflectionClass(static::class))->getConstants();
            unset(self::$meta[static::class]['__default']);

            if (method_exists(static::class, 'boot')) {
                static::boot();
            }
        }
    }
1289122
public function resetConfiguration()
    {
        $this->appRoot = dirname(dirname(dirname(__DIR__)));
        $this->config = json_decode(file_get_contents($this->appRoot . '/config.json'), true);
        $this->setEnvironmentInfo();
    }