From 9cad7bf537a14f925ecd5a9c5b59fc358362e162 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Tue, 4 Feb 2020 13:49:00 +0530 Subject: [PATCH] XLPATH CHANGED --- api/application/config/config.php | 2 +- api/index.php | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/api/application/config/config.php b/api/application/config/config.php index 25fdb8ff..bbaed9b2 100644 --- a/api/application/config/config.php +++ b/api/application/config/config.php @@ -234,7 +234,7 @@ $config['log_threshold'] = 1; | application/logs/ directory. Use a full server path with trailing slash. | */ -$config['external_data_path'] = $_SERVER['DOCUMENT_ROOT'].'/ssa_external_data/'.ENVIRONMENT; +$config['external_data_path'] = XLPATH; $config['full_server_name'] = (substr_count($_SERVER['HTTP_HOST'],'localhost') == 1 ? 'http://localhost':$_SERVER['HTTP_HOST']); $config['log_path'] = $config['external_data_path'].'/ci_logs/'; diff --git a/api/index.php b/api/index.php index 25ec6399..e87de8b9 100644 --- a/api/index.php +++ b/api/index.php @@ -58,25 +58,37 @@ if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'demo.pdgenie.com') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqapi') == 1) { define('ENVIRONMENT','development'); + define('XLPATH','/mnt/ssa_external_data/'.ENVIRONMENT); } else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'demo.pdgenie.com') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqtest') == 1) { define('ENVIRONMENT','testing'); + define('XLPATH','/mnt/ssa_external_data/'.ENVIRONMENT); } else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'pdgenie.com') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqprod') == 1) { define('ENVIRONMENT','production'); + define('XLPATH','/mnt/ssa_external_data/'.ENVIRONMENT); } else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'localhost') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqapi') == 1) { - define('ENVIRONMENT','testing'); + define('ENVIRONMENT','development'); + define('XLPATH',$_SERVER['DOCUMENT_ROOT'].'/ssa_external_data/'.ENVIRONMENT); + } else { define('ENVIRONMENT','development'); } + + + if( !defined('XLPATH') ) + { + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); + echo 'External Log Path Not defined.'; + exit(1); // EXIT_ERROR + } - //echo ENVIRONMENT; /* *--------------------------------------------------------------- * ERROR REPORTING @@ -95,7 +107,7 @@ switch (ENVIRONMENT) case 'testing': error_reporting(-1); - ini_set('display_errors', 0); + ini_set('display_errors', 1); break; case 'production': ini_set('display_errors', 0);