<?php

if (!file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . 'config/parameters.ini')) {
    exit('Your parameters file does not exist.');
}
$_parameters = parse_ini_file('config/parameters.ini', true);
define('_environment', $_parameters['app']['env']);
define('_domain', $_parameters['app']['domain']);
define('_site_domain', $_parameters['app']['site_domain']);
define('_admin_domain', $_parameters['app']['admin_domain']);
define('_locale', $_parameters['app']['locale']);
define('_language', $_parameters['language'][$_parameters['app']['locale']]);
define('_cache_prefix', $_parameters['app']['cache_prefix']);
define('_cookie_prefix', $_parameters['app']['cookie_prefix']);
// Databases connections
define('_dbhost', $_parameters['database']['dbhost']);
define('_dbdriver', $_parameters['database']['dbdriver']);
define('_dbuser', $_parameters['database']['dbuser']);
define('_dbpass', $_parameters['database']['dbpass']);
define('_dbname', $_parameters['database']['dbname']);
define('_dbport', $_parameters['database']['dbport']);

// Mailer connection
define('_mailer_protocol', $_parameters['mailer']['protocol']);
define('_mailer_server', $_parameters['mailer']['server']);
define('_mailer_user', $_parameters['mailer']['user']);
define('_mailer_pass', $_parameters['mailer']['pass']);
define('_encryption_key', $_parameters['security']['encryption_key']);