From: Davide Franco Date: Tue, 22 Mar 2011 14:53:47 +0000 (+0100) Subject: bacula-web: New classe BW_Config in config.classe.php X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=91b92d456a08b2766c57114b428c042a8fccb677;p=bacula%2Fbacula bacula-web: New classe BW_Config in config.classe.php --- diff --git a/gui/bacula-web/classes/cfg/config.classe.php b/gui/bacula-web/classes/cfg/config.classe.php index 4ee62fae70..eeab16c0b8 100644 --- a/gui/bacula-web/classes/cfg/config.classe.php +++ b/gui/bacula-web/classes/cfg/config.classe.php @@ -1,29 +1,49 @@ Check_Config_file() ) + return true; } public function Check_Config_file() { - + // Check if config file exist and is readable + return is_readable( CONFIG_FILE ); } public function Get_Config() { + $this->config = parse_ini_file( $this->config_file, true ); + if( !$this->config == false ) { + // Loading database connection information + foreach( $this->config as $parameter => $value ) + { + if( is_array($value) ) // Parsing database section + array_push( $this->catalogs, $value ); + } + return true; + }else + return false; } public function Get_Config_Params( $params = array() ) { - + if( isset( $this->config[$param] ) ) + return $this->config[$param]; + else + return false; } public function Count_Catalogs() { - + return count( $this->catalogs ); } public function Get_Dsn( $catalog_id ) @@ -33,7 +53,7 @@ function __destruct() { - + } } // end classe BW_Config