diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-29 14:24:30 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-29 14:24:30 -0500 |
commit | f03122d6fcefd9bd5103af78b5f6267c43f5ae29 (patch) | |
tree | 95d1f7786d7fc6977bed7fff1f17cf12032e06d3 | |
parent | 0e10923ff8560a6ff77221657617e8ad2432f5b0 (diff) | |
download | ampache-f03122d6fcefd9bd5103af78b5f6267c43f5ae29.tar.gz ampache-f03122d6fcefd9bd5103af78b5f6267c43f5ae29.tar.bz2 ampache-f03122d6fcefd9bd5103af78b5f6267c43f5ae29.zip |
Clean up Config
-rw-r--r-- | lib/class/config.class.php | 63 |
1 files changed, 14 insertions, 49 deletions
diff --git a/lib/class/config.class.php b/lib/class/config.class.php index 84129760..972bf6c7 100644 --- a/lib/class/config.class.php +++ b/lib/class/config.class.php @@ -35,69 +35,41 @@ */ class Config { - /** - * These are the settings for this specific class - * - * @var array - */ private $_local = array(); - - /** - * These are the global settings they go where it goes - * - * @var array - */ private static $_global = array(); - /** - * constructor - * This is what is called when the class is loaded - */ public function __construct() { - // Rien a faire - - } // constructor + } /** * get - * This checks to see if this is an instance or procedure - * call, procedure == global, instance == local * - * @param string $name - * @return mixed array or null + * This returns a config value. */ public static function get($name) { - - if (isset(self::$_global[$name])) { return self::$_global[$name]; } - else { return null; } - - } // get + if (isset(self::$_global[$name])) { + return self::$_global[$name]; + } + + return null; + } /** * get_all - * This returns all of the current config variables as an array * - * @return array + * This returns all of the current config variables as an array. */ public static function get_all() { - return self::$_global; - - } // get_all + } /** * set * * This sets config values. - * - * @param string $name Key name - * @param string $value Value name - * @param boolean $clobber Clobber flag true or false - * @return void */ 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(T_('Trying to clobber \'%s\' without setting clobber'), $name)); @@ -105,25 +77,18 @@ class Config { } self::$_global[$name] = $value; - - } // set + } /** * set_by_array * * This is the same as the set function except it takes an array as * input. - * - * @param array $array Array - * @param boolean $clobber Clobber flag true or false */ public static function set_by_array($array, $clobber = false) { - foreach ($array as $name => $value) { - self::set($name,$value,$clobber); + self::set($name, $value, $clobber); } - - } // set_by_array - -} // end Config class + } +} ?> |