configuration = array(); } // members private $configuration; public static function setConfiguration($configurationArray) { $conf = self::getInstance(); $conf->configuration = array_merge ($conf->configuration, $configurationArray); if ($autoloader = $conf->getConfig("autoloader")) { spl_autoload_register($autoloader); } } function getConfig($key, $default = null){ if (array_key_exists($key, $this->configuration)) return $this->configuration[$key]; else { if ($default) return $default; } return null; } function requireConfig($key){ if (($value = $this->getConfig($key)) == null) throw new Exception("Configuration for $key missing"); return $value; } } ?>