Sticky clear

@access public
@param string $module
960093
public static function cleanup() {
		if (!isset($_SESSION[Config::$sticky_session_name])) {
			return;
		}

		foreach ($_SESSION[Config::$sticky_session_name] as $key => $variables) {
			if (isset($variables['counter']) and $variables['counter'] < 1) {
				$_SESSION[Config::$sticky_session_name][$key]['counter']++;
				continue;
			}
			unset($_SESSION[Config::$sticky_session_name][$key]);
		}
	}
346670
def clear
      if @sticky.empty? then
        @ckh.clear
      else
        @ckh.each { |klass, ch| ch.clear unless @sticky.include?(klass) }
      end
    end
536075
function clear(): void {
        $queue = $this->queue;
        $this->queue = array();
        
        while($item = \array_shift($queue)) {
            unset($item);
        }
    }
701738
public function addModule($module) {
        $this->registerModule($module);
        if (is_object($module)) $module = $module->name;
        $this->userModules[] = $module;
    }
1111676
public function destroy($module)
    {
        /** @var \Nwidart\Modules\Module $module */
        $module = $this->modules->find($module);
        $module->delete();

        return $this->notifySuccess(trans('cms::module.destroy', ['module' => (string) $module]));
    }
585409
public function clear(bool $current = false): void
    {
        if ($current) {
            $this->curr->clear();
        }
        $this->next->clear();
    }
1374868
public function cleanup()
    {
        try {
            $this->driver->flushdb();
        } catch (\Exception $e) {
            throw new ModuleException(
                __CLASS__,
                $e->getMessage()
            );
        }
    }
371217
public function clearViewCache()
	{
	    $modules = $this->getModules();
	    if ($modules) foreach ($modules as $module) {
	        if ($instance = $this->getModule($module)) {
	            $instance->getView()->clearCache();
	        }
	    }
	    return true;
	}
678414
public function uninstall($modules)
    {
        $assetDir = $this->getModuleAssetDir();
        foreach ($modules as $name) {
            $publicPath = $assetDir.DIRECTORY_SEPARATOR.$name;
            if (is_dir($publicPath) || is_link($publicPath)) {
                $this->filesystem->remove($publicPath);
                $this->log("Removed module assets: <info>${name}</info>");
            }
        }
    }
1040792
public function clear($scope = null)
    {
        if ($scope === null) {
            $this->messages = array();
        } else {
            foreach ($this->messages as $key => $message) {
                if ($message['scope'] === $scope) {
                    unset($this->messages[$key]);
                }
            }
        }
        return $this;
    }
859262
public static function flush($scope = null) {
		if (empty($scope)) {
			self::$implementedEvents = self::$loadedListeners = self::$loadedScopes = array();
			return;
		}

		// foreach (self::)
	}
1169979
public function toggle($module)
    {
        /** @var \Nwidart\Modules\Module $module */
        $module = $this->modules->findByAlias($module);

        if ($module->disabled()) {
            $module->enable();
        } else {
            $module->disable();
        }

        $message = 'cms::module.toggle.' . ($module->enabled() ? 'enable' : 'disable');

        return $this->notifySuccess(trans($message, ['module' => (string) $module]));
    }
580230
private function setByModule(string $module) : void
    {
        $config = (new ModuleConfig(ConfigType::MODULE(), $module))->parse();
        $fields = $this->getModuleFields($module);

        if (! property_exists($config, 'table')) {
            return;
        }

        if (! property_exists($config->table, 'type')) {
            return;
        }

        if ('module' === $config->table->type) {
            $this->setByTypeModule($module, $fields);
        }

        if ('relation' === $config->table->type) {
            $this->setByTypeRelation($module, $fields);
        }

        if ($module === $this->getTableName()) {
            $this->setByTypeFile($module, $fields);
        }
    }
836821
public function add(Module $module)
    {
        $this->modules[$module->getName()] = $module;

        if ($module instanceof RootModule) {
            $this->rootModule = $module;
        }
    }
841492
public function dropSchema($module)
    {			
    		$res = $this->parseSchema($module);
    		if (is_array($res['tables'])) foreach ($res['tables'] as $table) {
            $this->dbConnection->executeQuery('DROP TABLE IF EXISTS `'.$table['name'].'`');
    		}
    		if (is_array($res['types'])) foreach ($res['types'] as $type) {
            try {
                ObjectDefinition::findByTable($type['name'])->delete();
            } catch (\Exception $e) {}
    		}        
    }
534725
protected function deleteHooks($module)
    {
        $query = ModuleHookQuery::create();
        if (null !== $module) {
            $query
                ->filterByModule($module)
                ->delete();
        } else {
            $query->deleteAll();
        }

        $query = IgnoredModuleHookQuery::create();
        if (null !== $module) {
            $query
                ->filterByModule($module)
                ->delete();
        } else {
            $query->deleteAll();
        }
    }
919490
public function setModule($module) {
        if (!is_string($module) || empty($module)) {
            $errMessage = "The module value must be a string and not be empty";
            throw new \InvalidArgumentException($errMessage, GeneralErrors::VALUE_IS_NOT_OF_EXPECTED_TYPE);
        }

        $this->module = $module;
    }