aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 9703a51aa..ac20b73bb 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1086,6 +1086,11 @@ SELECT param, value
trigger_action('load_conf', $condition);
}
+/**
+ * Add or update a config parameter
+ * @param string $param
+ * @param string $value
+ */
function conf_update_param($param, $value)
{
$query = '
@@ -1119,6 +1124,36 @@ UPDATE '.CONFIG_TABLE.'
}
/**
+ * Delete on or more config parameters
+ * @since 2.6
+ * @param string|string[] $params
+ */
+function conf_delete_param($params)
+{
+ global $conf;
+
+ if (!is_array($params))
+ {
+ $params = array($params);
+ }
+ if (empty($params))
+ {
+ return;
+ }
+
+ $query = '
+DELETE FROM '.CONFIG_TABLE.'
+ WHERE param IN(\''. implode('\',\'', $params) .'\')
+;';
+ pwg_query($query);
+
+ foreach ($params as $param)
+ {
+ unset($conf[$param]);
+ }
+}
+
+/**
* Prepends and appends a string at each value of the given array.
*
* @param array