_local[$name]; } else { return self::$_global[$name]; } } // get /** * This checks to see if this is an instance or procedure calls * and then sets the correct variable based on that */ public static function set($name, $value, $clobber = 0) { if (isset($this)) { if (isset($this->_local[$name]) && !$clobber) { Error::add('Config Instance',"Trying to clobber '$name' without setting clobber"); return; } else { $this->_local[$name] = $value; } } // if object else { if (isset(self::$_global[$name]) && !$clobber) { Error::add('Config Global',"Trying to clobber'$name' without setting clobber"); return; } else { self::$_global[$name] = $value; } } // else not object, procedure call } // set /** * This is the same as the set function except it takes an array as input */ public static function set_by_array($array, $clobber = 0) { if (isset($this)) { foreach ($array as $name => $value) { $this->set($name, $value, $clobber); } // end foreach } // if this is an object else { foreach ($array as $name => $value) { self::set($name,$value,$clobber); } } // end if procedural call } // set_by_array } // end Config class ?>