$value) { /** * Transform from json to native config types */ // switch ($key) { // case 'POSTGREY_WHITELIST_DOMAINS': // $value = implode("\n", $value); // break; // case 'POSTFIXADMIN_SETUP_PASSWORD': // $value = password_hash($value, '2y'); // break; // case 'ROUNDCUBE_PLUGIN_ALIAS_ADDRESSBOOK_DOMAINS': // $value = json_encode($value); // break; // case 'ROUNDCUBE_PLUGIN_ALIAS_ADDRESSBOOK_USERS': // $value = json_encode($value); // break; // case 'ROUNDCUBE_PLUGIN_X2FA_ENABLED_METHODS': // $value = json_encode($value); // break; // } $content = str_replace('{{' . $key . '}}', $value, $content); } exit(file_put_contents($file_path, $content) === false ? 1 : 0);