Removes module data from cache directory

@param string $module
@return boolean
481461
public function removeFromCacheDir($module)
    {
        // Create a path
        $path = $this->appConfig->getModuleCacheDir($module);
        return $this->performRemoval($path);
    }
1128944
public function deactivateModule(DynamicModule $module)
    {
        if (!is_null($module)) {
            $module->setActive(false);
            return $this->registry->register($module);
        }
        
        return false;
    }
284946
def remove_module(self, module):
        
        with ffi.OutputString() as outerr:
            if ffi.lib.LLVMPY_RemoveModule(self, module, outerr):
                raise RuntimeError(str(outerr))
        self._modules.remove(module)
        module._owned = False
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;
    }
1144483
protected function isAllModulesLoaded( array $modules )
    {
        foreach ( $modules as $module )
        {
            if ( ! $this->isModuleLoaded( $module ) )
            {
                return false;
            }
        }

        return true;
    }
545539
public function remove($module, $name)
    {
        $index = 0;

        if ($this->has($module, $name, $index)) {
            unset($this->data[$index]);
        }
    }
1122268
public function isSiteModule($module)
    {
        $repos = $this->getComposer()->getRepositoryManager()->getLocalRepository();

        $composerFile = $_SERVER['DOCUMENT_ROOT'] . '/../vendor/composer/installed.json';
        $composer = (array) \Zend\Json\Json::decode(file_get_contents($composerFile));

        $repo = null;

        foreach ($composer as $package) {
            $packageModuleName = isset($package->extra) ? (array) $package->extra : null;

            if (isset($packageModuleName['module-name']) && $packageModuleName['module-name'] == $module) {
                $repo = (array) $package->extra;
                break;
            }
        }

        if ($repo) {
            if(isset($repo['melis-site'])) {
                return (bool)$repo['melis-site'] ?? false;
            }
        }

        return false;
    }
85986
public static function exists($module)
	{
		if (array_key_exists($module, static::$modules))
		{
			return static::$modules[$module];
		}
		else
		{
			$paths = \Config::get('module_paths', array());

			foreach ($paths as $path)
			{
				if (is_dir($path.$module))
				{
					return $path.$module.DS;
				}
			}
		}

		return false;
	}
1368203
public function remove()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_diff($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
228374
public function removeCache()
	{
		if ( ! $this->useCache || ! $this->cacheLocation ) return false;

		if ( ! is_dir( $this->cacheLocation ) ) return false;

		$rmrf = function ($dir) use ( &$rmrf )
		{
		    foreach ( glob( $dir ) as $file )
		    {
		        if ( is_dir( $file ) )
		        {
		            $rmrf( "$file/*" );
		            rmdir( $file );
		        }
		        else
		        {
		            unlink( $file );
		        }
		    }
		};

		$rmrf( $this->cacheLocation );

		return true;
	}
662322
public function remove(Module $removedModule) : array
    {
        $allModules = $this->storage->read();

        foreach ($allModules as $key => $module) {
            if ($removedModule->equals($module)) {
                unset($allModules[$key]);
            }
        }

        $this->storage->write($allModules);

        return $allModules;
    }
632511
public function isModulesLoaded( $modules )
    {
        if ( $modules instanceof Traversable )
        {
            $modules = ArrayUtils::iteratorToArray( $modules );
        }

        if ( ! is_array( $modules ) )
        {
            $modules = preg_split( '/\|{1,2}/', (string) $modules );
        }

        foreach ( $modules as $module )
        {
            if ( ! is_array( $module ) )
            {
                $module = preg_split( '/&{1,2}/', (string) $module );
            }

            if ( $this->isAllModulesLoaded( $module ) )
            {
                return true;
            }
        }

        return false;
    }
122508
private function _delete_dir($path = '')
    {
        $cache_path = $this->config->get('cache_path');

        // make sure nobody can delete above the cache root
        if (strpos($path, $cache_path) === false) return;

        if (is_file($path)) {
            return (bool) unlink($path);
        } elseif (is_dir($path)) {
            $scan = glob(rtrim($path,'/').'/*');

            foreach ($scan as $item) {
                $this->_delete_dir($item);
            }

            return rmdir($path);
        }
    }
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;
    }
259147
public function isModuleCurrent(string $module): bool
	{
		return strpos($this->getAction(true), $module) !== false;
	}
1162334
public function getModuleDir($module, $dir)
    {
        return $this->jsDir.DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$this->getModuleFileName($module);
    }
454871
public function removeAssets($moduleName)
    {
        $assets = $this->getAssetDirectory($moduleName);

        $this->files->deleteDirectory($assets);
        if ($this->files->exists($assets))
        {
            $this->errors->add('delete_assets', 'Unable to delete assets in: '.$assets);
            return false;
        }
        return true;
    }