aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-01-14 11:23:45 +0100
committerplegall <plg@piwigo.org>2016-01-14 11:23:45 +0100
commitc79cb18e44a09b5d4330a8ea285447190c231952 (patch)
treeffa6f9e0521b33d282a99c0d5566d59e1199fc33 /include
parent9b10ebad3aef8d9a602d4395e7f355300d089997 (diff)
parentc44a5e289021c68fdf882e83835e34fccdc49c50 (diff)
Merge branch 'feature/293-trigger-upload'
Diffstat (limited to 'include')
-rw-r--r--include/functions.inc.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 578830ba5..634cf61a8 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1297,6 +1297,32 @@ DELETE FROM '.CONFIG_TABLE.'
}
/**
+ * Return a default value for a configuration parameter.
+ * @since 2.8
+ *
+ * @param string $param the configuration value to be extracted (if it exists)
+ * @param mixed $default_value the default value for the configuration value if it does not exist.
+ *
+ * @return mixed The configuration value if the variable exists, otherwise the default.
+ */
+function conf_get_param($param, $default_value=null)
+{
+ global $conf;
+
+ if (isset($conf[$param]))
+ {
+ return $conf[$param];
+ }
+ elseif (isset($default_value))
+ {
+ return $default_value;
+ }
+
+ return null;
+}
+
+
+/**
* Apply *unserialize* on a value only if it is a string
* @since 2.7
*