// Global constants
define('CONFIG_DIR', BW_ROOT . "/config/");
define('CONFIG_FILE', CONFIG_DIR . "config.php");
- require_once( CONFIG_FILE );
// Time intervals in secondes
define( 'LAST_DAY', 86400 );
$this->bwcfg = new BW_Config();
$dsn = array();
- // Checking if config file exist and is readable
- if( !$this->bwcfg->Check_Config_File() )
- die( "Unable to load configuration file" );
- else {
- $this->bwcfg->Load_Config();
- $this->catalog_nb = $this->bwcfg->Count_Catalogs();
- }
+ // Loading configuration from config file
+ $this->bwcfg->Load_Config();
+ $this->catalog_nb = $this->bwcfg->Count_Catalogs();
// Select which catalog to connect to
if( isset( $_POST['catalog_id'] ) )
{
global $config;
+ if( $this->Check_Config_file() )
+ include_once( CONFIG_FILE );
+ else
+ die( "Configuration file not found" );
+
if( is_array($config) && !empty($config) ) {
// Loading database connection information
foreach( $config as $parameter => $value )