AMDAIntegrationConfig.php 1.97 KB
<?php 

$config_file=__DIR__."/current.env";

if (!file_exists($config_file)) {
	//DEPRECATED - Defined for compatbility mode! For new instance, copy the template file config/current.env.template in config/current.env and replace placeholders by your own values
	$localIP = exec("hostname -i");
	switch ($localIP)
	{
		case  '172.25.30.65' :
			$config_file=__DIR__."/predefined_env/akka-dev.env";
			break;
		case '10.168.220.87' :
			$config_file=__DIR__."/predefined_env/akka-integration.env";
			break;
		case '195.83.102.55' :
			$config_file=__DIR__."/predefined_env/irap-test.env";
			break;
		case '10.121.0.3' :
			$config_file=__DIR__."/predefined_env/apus-dev.env";
			break;
		case '10.121.1.121' :
			$config_file=__DIR__."/predefined_env/pc1121-dev.env";
		case '10.121.0.31' :
			$config_file=__DIR__."/predefined_env/irap-amdatest.env";
        	case '192.168.83.101' :
			$config_file=__DIR__."/predefined_env/akka-amdadev.env";
                	break;
		default:
			$config_file="";
	}
}

if (empty($config_file) || !file_exists($config_file) || ($config=parse_ini_file($config_file)) == FALSE) {
        throw new Exception("Error to load environment config file ".$config_file);
}

define('COTS_BASE_DIR', $config['COTS_BASE_DIR']);
define('TOOLS_BASE_DIR', $config['TOOLS_BASE_DIR']);
define('KERNEL_BUILD_TYPE', $config['KERNEL_BUILD_TYPE']);
define('AMDA_KERNEL_DIR', $config['AMDA_KERNEL_DIR']);
define('IHM_SRC_DIR', $config['IHM_SRC_DIR']);

define('GCC_BASE_DIR', TOOLS_BASE_DIR.'/gcc/4.7.2/rtf');
define('BOOST_BASE_DIR', TOOLS_BASE_DIR.'/gcc/4.7.2/boost');
define('KERNEL_CONFIG_DIR',__DIR__.'/kernel');
define('DDRES_DIR',__DIR__.'/kernel');
define('AMDA_KERNEL_SRC_DIR', AMDA_KERNEL_DIR.'/src');
define('AMDA_KERNEL_BUILD_DIR', AMDA_KERNEL_DIR.'/build/'.KERNEL_BUILD_TYPE);

//Path to AMDA_Integration source dir
if (defined('INTEGRATION_BASE_PATH')) {
	define('INTEGRATION_SRC_DIR', INTEGRATION_BASE_PATH.'/src/');
}
else {
	define('INTEGRATION_SRC_DIR', __DIR__."/../src");
}

?>