Forgot default config values in index
[gitphp.git] / include / Config.class.php
blob:a/include/Config.class.php -> blob:b/include/Config.class.php
--- a/include/Config.class.php
+++ b/include/Config.class.php
@@ -1,24 +1,4 @@
 <?php
-/**
- * Constant for tar archive
- */
-define('GITPHP_COMPRESS_TAR', 'tar');
-
-/**
- * Constant for bz2 archive
- */
-define('GITPHP_COMPRESS_BZ2', 'tbz2');
-
-/**
- * Constant for gz archive
- */
-define('GITPHP_COMPRESS_GZ', 'tgz');
-
-/**
- * Constant for zip archive
- */
-define('GITPHP_COMPRESS_ZIP', 'zip');
-
 /**
  * Configfile reader class
  *
@@ -28,14 +8,6 @@
  */
 class GitPHP_Config
 {
-	
-	/**
-	 * Stores the singleton instance
-	 *
-	 * @var GitPHP_Config
-	 */
-	protected static $instance;
-
 	/**
 	 * Stores the config values
 	 *
@@ -44,44 +16,9 @@
 	protected $values = array();
 
 	/**
-	 * Stores the default values
-	 *
-	 * @var array
-	 */
-	protected $defaults = array();
-
-	/**
-	 * Stores the config files
-	 *
-	 * @var string[]
-	 */
-	protected $configs = array();
-
-	/**
-	 * Returns the singleton instance
-	 *
-	 * @return GitPHP_Config instance of config class
-	 */
-	public static function GetInstance()
-	{
-		if (!self::$instance) {
-			self::$instance = new GitPHP_Config();
-		}
-		return self::$instance;
-	}
-
-	/**
-	 * Releases the singleton instance
-	 */
-	public static function DestroyInstance()
-	{
-		self::$instance = null;
-	}
-
-	/**
 	 * Class constructor
 	 */
-	private function __construct()
+	public function __construct()
 	{
 		$this->InitializeDefaults();
 	}
@@ -98,18 +35,16 @@
 		// making use of these variables in their title
 		global $gitphp_version, $gitphp_appstring;
 
-		if (!is_file($configFile)) {
-			throw new GitPHP_MessageException('Could not load config file ' . $configFile, true, 500);
+		if (!is_readable($configFile)) {
+			throw new GitPHP_InvalidConfigFileException($configFile);
 		}
 
 		if (!include($configFile)) {
-			throw new GitPHP_MessageException('Could not read config file ' . $configFile, true, 500);
+			throw new GitPHP_InvalidConfigFileException($configFile);
 		}
 
 		if (isset($gitphp_conf) && is_array($gitphp_conf))
 			$this->values = array_merge($this->values, $gitphp_conf);
-
-		$this->configs[] = $configFile;
 	}
 
 	/**
@@ -118,7 +53,7 @@
 	public function ClearConfig()
 	{
 		$this->values = array();
-		$this->configs = array();
+		$this->InitializeDefaults();
 	}
 
 	/**
@@ -191,6 +126,8 @@
 		$this->values['exportedonly'] = false;
 		$this->values['compressformat'] = GITPHP_COMPRESS_ZIP;
 		$this->values['locale'] = 'en_US';
+		$this->values['graphs'] = false;
+		$this->values['objectcachecompress'] = 500;
 	}
 
 }

comments