Skip to content

Commit

Permalink
CONFIG_FILE path as constant in index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejlew committed Jun 19, 2014
1 parent df32561 commit 52b9781
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
*/

// REPLACE THIS WITH PATH TO YOUR CONFIG FILE

$CONFIG_FILE = '/etc/lms/lms.ini';
define('CONFIG_FILE', 'lms.ini');

// PLEASE DO NOT MODIFY ANYTHING BELOW THIS LINE UNLESS YOU KNOW
// *EXACTLY* WHAT ARE YOU DOING!!!
Expand All @@ -36,15 +35,7 @@
define('LMS-UI', true);
ini_set('error_reporting', E_ALL&~E_NOTICE);

// find alternative config files:
if(is_readable('lms.ini'))
$CONFIG_FILE = 'lms.ini';
elseif(is_readable('/etc/lms/lms-'.$_SERVER['HTTP_HOST'].'.ini'))
$CONFIG_FILE = '/etc/lms/lms-'.$_SERVER['HTTP_HOST'].'.ini';
elseif(!is_readable($CONFIG_FILE))
die('Unable to read configuration file ['.$CONFIG_FILE.']!');

$CONFIG = (array) parse_ini_file($CONFIG_FILE, true);
$CONFIG = (array) parse_ini_file(CONFIG_FILE, true);

// Check for configuration vars and set default values
$CONFIG['directories']['sys_dir'] = (!isset($CONFIG['directories']['sys_dir']) ? getcwd() : $CONFIG['directories']['sys_dir']);
Expand Down

0 comments on commit 52b9781

Please sign in to comment.