pickles/classes/Config.php
Josh Sherman 4bedbb02be Initial import.
git-svn-id: http://svn.cleancode.org/svn/pickles@1 4d10bc64-7434-11dc-a737-d2d0f8310089
2007-10-06 17:48:52 +00:00

39 lines
745 B
PHP
Executable file

<?php
class Config {
private static $data;
public static function load($site) {
// @todo no hardcoded paths!
$file = "/home/websites/111110/common/config/{$site}.ini";
if (file_exists($file)) {
self::$data =& parse_ini_file($file, true);
}
else {
Error::addError('Unable to load the configuration file');
return false;
}
return true;
}
public static function get($variable, $section = null) {
return isset($section) ? self::$data[$section][$variable] : self::$data[$variable];
}
public static function enableDebug() {
self::$data['debug'] = true;
}
public static function disableDebug() {
self::$data['debug'] = false;
}
public static function getDebug() {
return self::get('debug');
}
}
?>