Commit 5d3febfa7b92dcd9a0cd7304bae2da105e2d5983
1 parent
cf980a03
Allow for a file to specify where to find the configuration file.
Set the LANGUAGE environment variable as well as LANG Set arg_separator.output to '&' in case it has been changed to something else. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4906 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
9 additions
and
1 deletions
config/config-path
0 → 100644
| 1 | +config/config.ini |
config/dmsDefaults.php
| @@ -29,6 +29,7 @@ error_reporting(E_ALL & ~E_NOTICE); | @@ -29,6 +29,7 @@ error_reporting(E_ALL & ~E_NOTICE); | ||
| 29 | ini_set('display_errors', '1'); | 29 | ini_set('display_errors', '1'); |
| 30 | ini_set('display_startup_errors', '1'); | 30 | ini_set('display_startup_errors', '1'); |
| 31 | ini_set('magic_quotes_runtime', '0'); | 31 | ini_set('magic_quotes_runtime', '0'); |
| 32 | +ini_set('arg_separator.output', '&'); | ||
| 32 | 33 | ||
| 33 | // If not defined, set KT_DIR based on my usual location in the tree | 34 | // If not defined, set KT_DIR based on my usual location in the tree |
| 34 | if (!defined('KT_DIR')) { | 35 | if (!defined('KT_DIR')) { |
| @@ -115,6 +116,7 @@ class KTInit { | @@ -115,6 +116,7 @@ class KTInit { | ||
| 115 | $default->defaultLanguage = $sLocale; | 116 | $default->defaultLanguage = $sLocale; |
| 116 | } | 117 | } |
| 117 | putenv('LANG=' . $default->defaultLanguage); | 118 | putenv('LANG=' . $default->defaultLanguage); |
| 119 | + putenv('LANGUAGE=' . $default->defaultLanguage); | ||
| 118 | setlocale(LC_ALL, $default->defaultLanguage); | 120 | setlocale(LC_ALL, $default->defaultLanguage); |
| 119 | // Set the text domain | 121 | // Set the text domain |
| 120 | $sDomain = 'knowledgeTree'; | 122 | $sDomain = 'knowledgeTree'; |
| @@ -328,7 +330,12 @@ class KTInit { | @@ -328,7 +330,12 @@ class KTInit { | ||
| 328 | function readConfig () { | 330 | function readConfig () { |
| 329 | global $default; | 331 | global $default; |
| 330 | $oKTConfig =& KTConfig::getSingleton(); | 332 | $oKTConfig =& KTConfig::getSingleton(); |
| 331 | - $oKTConfig->loadFile(KT_DIR . "/config/config.ini"); | 333 | + $sConfigFile = trim(file_get_contents(KT_DIR . "/config/config-path")); |
| 334 | + if (KTUtil::isAbsolutePath($sConfigFile)) { | ||
| 335 | + $oKTConfig->loadFile($sConfigFile); | ||
| 336 | + } else { | ||
| 337 | + $oKTConfig->loadFile(sprintf("%s/%s", KT_DIR, $sConfigFile)); | ||
| 338 | + } | ||
| 332 | foreach (array_keys($oKTConfig->flat) as $k) { | 339 | foreach (array_keys($oKTConfig->flat) as $k) { |
| 333 | $v = $oKTConfig->get($k); | 340 | $v = $oKTConfig->get($k); |
| 334 | if ($v === "default") { | 341 | if ($v === "default") { |