<commit_before><?php
	require_once 'Utils.php';

	class ModuleManager
	{
		private $Caller = null;
		private $Utils = null;

		private $Modules = array();
		private $DomainModules = array();
		private $ExtModules = array();

		public function __construct(WhatsBotCaller &$Caller)
		{
			$this->Caller = &$Caller;
			$this->Utils = new Utils();
		}

		public function LoadModules() // devolver lista de modulos cargados
		{
			$Modules = $this->Utils->getJson('config/Modules.json');

			if($Modules !== false)
			{
				$Commands = $Modules['modules']['commands'];
				$Domains = $Modules['modules']['domains'];
				$Extensions = $Modules['modules']['exts'];

				foreach($Commands as $Command)
					$this->LoadModule($Command);

				foreach($Domains as $Domain)
					$this->LoadDomainModule($Domain);

				foreach($Extensions as $Extension)
					;//$this->LoadExtensionModule($Extension);
			}
		}

		private function LoadModule($Name) // public for !load or !reload
		{
			$JsonFile = "class/modules/cmd_{$Name}.json";
			$PHPFile = "class/modules/cmd_{$Name}.php";

			if(is_file($JsonFile) && is_file($PHPFile))
			{
				$Data = $this->Utils->getJson($JsonFile);

				$this->Modules[strtolower($Name)] = array
				(
					'help' => (isset($Data['help'])) ? $Data['help'] : null,<commit_msg>Using static Utils in ModuleManager<commit_after><?php
	require_once 'Utils.php';

	class ModuleManager
	{
		private $Caller = null;

		private $Modules = array();
		private $DomainModules = array();
		private $ExtModules = array();

		public function __construct(WhatsBotCaller &$Caller)
		{
			$this->Caller = &$Caller;
		}

		public function LoadModules() // devolver lista de modulos cargados
		{
			$Modules = Utils::GetJson('config/Modules.json');

			if($Modules !== false)
			{
				$Commands = $Modules['modules']['commands'];
				$Domains = $Modules['modules']['domains'];
				$Extensions = $Modules['modules']['exts'];

				foreach($Commands as $Command)
					$this->LoadModule($Command);

				foreach($Domains as $Domain)
					$this->LoadDomainModule($Domain);

				foreach($Extensions as $Extension)
					;//$this->LoadExtensionModule($Extension);
			}
		}

		private function LoadModule($Name) // public for !load or !reload
		{
			$JsonFile = "class/modules/cmd_{$Name}.json";
			$PHPFile = "class/modules/cmd_{$Name}.php";

			if(is_file($JsonFile) && is_file($PHPFile))
			{
				$Data = Utils::GetJson($JsonFile);

				$this->Modules[strtolower($Name)] = array
				(
					'help' => (isset($Data['help'])) ? $Data['help'] : null,
{'fraction_non_alphanumeric': 0.17823343848580442, 'fraction_numerical': 0.0, 'mean_word_length': 3.94541910331384, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4787342', 'n_tokens_mistral': 971, 'n_tokens_neox': 823, 'n_words': 159}