summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2012-03-06 12:18:10 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2012-03-06 12:18:10 -0500
commit08a4f848be123b9ac3a1b59e0ce0821e6df9fe26 (patch)
tree1a482d3a36e2ad0ce3b94b8181f90ceec2e0b2c9
parent585382422c5198eebf1af070b68ed3ecf70c3e7d (diff)
downloadampache-08a4f848be123b9ac3a1b59e0ce0821e6df9fe26.tar.gz
ampache-08a4f848be123b9ac3a1b59e0ce0821e6df9fe26.tar.bz2
ampache-08a4f848be123b9ac3a1b59e0ce0821e6df9fe26.zip
Clean up Config::set and Config::set_by_array
Boolean parameters should be boolean.
-rw-r--r--lib/class/config.class.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/class/config.class.php b/lib/class/config.class.php
index e12fdedc..78745be8 100644
--- a/lib/class/config.class.php
+++ b/lib/class/config.class.php
@@ -98,34 +98,36 @@ class Config {
/**
* set
- * This checks to see if this is an instance or procedure calls
- * and then sets the correct variable based on that
+ *
+ * This sets config values.
*
* @param string $name Key name
* @param string $value Value name
- * @param integer $clobber Clobber flag 0 or 1
+ * @param boolean $clobber Clobber flag true or false
* @return void
*/
- public static function set($name, $value, $clobber = 0) {
+ public static function set($name, $value, $clobber = false) {
if (isset(self::$_global[$name]) && !$clobber) {
+ debug_event('Config', "Tried to overwrite existing key $name without setting clobber", 5);
Error::add('Config Global', sprintf(_('Trying to clobber \'%s\' without setting clobber'), $name));
- return;
- }
- else {
- self::$_global[$name] = $value;
+ return false;
}
+
+ self::$_global[$name] = $value;
} // set
/**
* set_by_array
- * This is the same as the set function except it takes an array as input
+ *
+ * This is the same as the set function except it takes an array as
+ * input.
*
* @param array $array Array
- * @param integer $clobber Clobber flag 0 or 1
+ * @param boolean $clobber Clobber flag true or false
*/
- public static function set_by_array($array, $clobber = 0) {
+ public static function set_by_array($array, $clobber = false) {
foreach ($array as $name => $value) {
self::set($name,$value,$clobber);