leilukin-tumbleblog/modules/maptcha/upgrades.php

32 lines
804 B
PHP
Raw Permalink Normal View History

2024-06-20 14:10:42 +00:00
<?php
if (!defined('UPGRADING') or !UPGRADING)
exit;
/**
* Function: maptcha_migrate_config
* Moves config settings into an array.
*
* Versions: 2017.01 => 2017.02
*/
function maptcha_migrate_config(): void {
$config = Config::current();
if (isset($config->maptcha_hashkey)) {
$set = $config->set(
"module_maptcha",
array("maptcha_hashkey" => $config->maptcha_hashkey)
);
if ($set !== false)
$set = $config->remove("maptcha_hashkey");
if ($set === false)
error(
__("Error"),
__("Could not write the configuration file.")
);
}
}
maptcha_migrate_config();