$cfg['core_name'] = detectCore() or die('Cannot detect core'); //set default database name $cfg['db_name'] = PREFIX . $cfg['core_name']; //loading core defined params try { $cfg = array_merge($cfg, Config::getPlatformConfigForCore($cfg['core_name'])); } catch (\Exception $e) { //return http "not found" if cant load core config header(@$_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found'); exit; } DB\connectWithParams($cfg); //loading full config of the core $config = Config::load($cfg); //analize core status and display corresponding message if not active $status = Config::getCoreStatus(); if ($status != Config::$CORESTATUS_ACTIVE) { echo Config::getCoreStatusMessage($status); exit; } //connect other database if specified in config for core DB\connectWithParams($config); /** * So, we have defined main paths and loaded configs. * Now define and configure all other options (for php, session, etc) **/ /* setting php configuration options, session lifetime and error_reporting level */ ini_set('max_execution_time', 500); ini_set('short_open_tag', 'off'); // upload params ini_set('upload_max_filesize', '200M');