@param $module

@return bool
349480
public function loadModule($module)
    {
        $trgtModule = $module;
        if (is_array($module) && !empty($module)) {
            $trgtModule = $module[count($module)-1];
        }

        if (!in_array($trgtModule, $this->getActiveModules())) {
            $moduleLoadFile = $_SERVER['DOCUMENT_ROOT'] . '/../config/melis.module.load.php';
            if (file_exists($moduleLoadFile)) {
                $modules = include $_SERVER['DOCUMENT_ROOT'] . '/../config/melis.module.load.php';

                $moduleCount = count($modules);
                $insertAtIdx = $moduleCount - 1;
                array_splice($modules, $insertAtIdx, 0, $module);

                // create the module.load file
                $this->createModuleLoader('config/', $modules, [], []);
            }
        }

        return $this->isModuleLoaded($trgtModule);
    }
1070173
private function getIndexesByModule($module)
    {
        // Indexes to be removed
        $indexes = array();

        foreach ($this->data as $index => $row) {
            if (isset($row[ConstProviderInterface::CONFIG_PARAM_MODULE]) && $row[ConstProviderInterface::CONFIG_PARAM_MODULE] == $module) {
                array_push($indexes, $index);
            }
        }

        return $indexes;
    }
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;
    }
1011406
public function removeModule($module)
    {
        foreach ($this->modules as $key => $moduleElement) {
            if ($moduleElement === $module) {
                unset($this->modules[$key]);
                break;
            }
        }

        return $this;
    }
98437
public static function loadScriptingModule($module)
    {
        $fullScriptPath = false;

        //  Remove any quotes from this passed in module
        $module = trim(str_replace(["'", '"'], null, $module), ' /');

        //  Check the configured script paths
        if (null === ($script = array_get(static::$libraries, $module))) {
            $script = $module;
        }

        foreach (static::$libraryPaths as $key => $path) {
            $checkScriptPath = $path . DIRECTORY_SEPARATOR . $script;

            if (is_file($checkScriptPath) && is_readable($checkScriptPath)) {
                $fullScriptPath = $checkScriptPath;
                break;
            }
        }

        if (!$script || !$fullScriptPath) {
            throw new InternalServerErrorException(
                'The module "' . $module . '" could not be found in any known locations.'
            );
        }

        return file_get_contents($fullScriptPath);
    }
1002812
public static function remove_module( $module ) {
		$key = array_search( $module, self::$modules, true );
		if ( false !== $key ) {
			unset( self::$modules[ $key ] );
		}
	}
441673
protected function getModuleOutput($module)
    {
        $console = $this->console;

        $head = sprintf(
            "%s\n%s\n%s\n",
            str_repeat(
                '-',
                $console->getWidth()
            ),
            'Testing Module: ' . $module,
            str_repeat(
                '-',
                $console->getWidth()
            )
        );

        return $console->colorize($head, ColorInterface::BLUE);
    }
843501
public function getClassByModule($module): ?string
    {
        if ($module instanceof Module || $module instanceof ModuleModel) {
            return Module::findClass($module->type);
        }

        if (\is_string($module)) {
            return Module::findClass($module);
        }

        return null;
    }
517157
public function checkDependenciesExtensions(array $module)
    {
        if (!empty($module['extensions'])) {

            $missing = array();

            foreach ($module['extensions'] as $extension) {
                if (!extension_loaded($extension)) {
                    $missing[] = $extension;
                }
            }

            if (!empty($missing)) {
                $error = $this->translation->text("Missing PHP extensions: @list", array('@list' => implode(',', $missing)));
                throw new UnexpectedValueException($error);
            }
        }

        return true;
    }
711809
public function checkAccess($module) {
		//$module pdoit être un nom de module.
		if( !isset($GLOBALS['ACCESS']->$module) ) {
			return true;
		}
		return $this->checkPerm((int) $GLOBALS['ACCESS']->$module);
	}
1128944
public function deactivateModule(DynamicModule $module)
    {
        if (!is_null($module)) {
            $module->setActive(false);
            return $this->registry->register($module);
        }
        
        return false;
    }
167078
public function checkMethod ($method)
	{
		
		// Method name
		
		$method	= strtolower ($method);
		
		// Get module class name
		
		$class	= $this->getModuleClass ();
		
		// Get methods
		
		$this->getMethods ();
		
		// Loop through the methods
		
		foreach ($this->methods as $obj)
		{
			
			// If the method names match return TRUE and the method exists in the class
			
			if (strtolower ($obj->get ('name')) == $method && method_exists ($class, $method))
			{
				return TRUE;
			}
			
		}
		
		// Return FALSE
		
		return FALSE;
		
	}
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) {}
    		}        
    }
851565
public function removeFromUploadsDir($module)
    {
        // Create a path
        $path = $this->appConfig->getModuleUploadsDir($module);
        return $this->performRemoval($path);
    }
108133
public function isModuleEnabled($modulePath)
    {
        $modulePathSegments = explode('/', $modulePath);
        $moduleConfiguration = Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $modulePathSegments));
        if (isset($moduleConfiguration['enabled']) && $moduleConfiguration['enabled'] !== true) {
            return false;
        }
        array_pop($modulePathSegments);
        if ($modulePathSegments === []) {
            return true;
        }
        return $this->isModuleEnabled(implode('/', $modulePathSegments));
    }
451985
public function setModule($module)
    {
        $this->module = is_string($module) ? $module : $this->$module;
        $this->prepareUrl();

        return $this;
    }
867800
private function enable($module)
    {
        if (!array_key_exists($module, $this->enabled)) {
            throw new \InvalidArgumentException("Module '$module' cannot be enabled or disabled. Only [".implode(', ', array_keys($this->enabled)).'] can.');
        }

        $this->enabled[$module] = true;

        return $this;
    }