public function registerConstant($name, $comment, $type, $defaultvalue = "", $value = "", $selfedit = "false", $fetchFromEnv = "false") {
		$this->selfedit = $selfedit;
		
		if ($selfedit == "true") {
			$this->moufManager = MoufManager::getMoufManager();
		} else {
			$this->moufManager = MoufManager::getMoufManagerHiddenInstance();
		}
		$this->configManager = $this->moufManager->getConfigManager();
		
		if ($type == "int") {
		    $value = $value !== '' ? (int) $value : '';
			$defaultvalue = $defaultvalue !== '' ? (int) $defaultvalue : '';
		} else if ($type == "float") {
			$value = (float) $value;
			$defaultvalue = (float) $defaultvalue;
		} else if ($type == "bool") {
			if ($value == "true") {
				$value = true;
			} else {
				$value = false;
			}
			if ($defaultvalue == "true") {
				$defaultvalue = true;
			} else {
				$defaultvalue = false;
			}
		}
		
		$this->configManager->registerConstant($name, $type, $defaultvalue, $comment, $fetchFromEnv === 'true');
		$this->moufManager->rewriteMouf();
		
		// Now, let's write the constant for our environment:
		$this->constantsList = $this->configManager->getDefinedConstants();
		$this->constantsList[$name] = $value;
		$this->configManager->setDefinedConstants($this->constantsList);
		
		header("Location: .?selfedit=".$selfedit);
	}