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 | 29 | ini_set('display_errors', '1'); |
| 30 | 30 | ini_set('display_startup_errors', '1'); |
| 31 | 31 | ini_set('magic_quotes_runtime', '0'); |
| 32 | +ini_set('arg_separator.output', '&'); | |
| 32 | 33 | |
| 33 | 34 | // If not defined, set KT_DIR based on my usual location in the tree |
| 34 | 35 | if (!defined('KT_DIR')) { |
| ... | ... | @@ -115,6 +116,7 @@ class KTInit { |
| 115 | 116 | $default->defaultLanguage = $sLocale; |
| 116 | 117 | } |
| 117 | 118 | putenv('LANG=' . $default->defaultLanguage); |
| 119 | + putenv('LANGUAGE=' . $default->defaultLanguage); | |
| 118 | 120 | setlocale(LC_ALL, $default->defaultLanguage); |
| 119 | 121 | // Set the text domain |
| 120 | 122 | $sDomain = 'knowledgeTree'; |
| ... | ... | @@ -328,7 +330,12 @@ class KTInit { |
| 328 | 330 | function readConfig () { |
| 329 | 331 | global $default; |
| 330 | 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 | 339 | foreach (array_keys($oKTConfig->flat) as $k) { |
| 333 | 340 | $v = $oKTConfig->get($k); |
| 334 | 341 | if ($v === "default") { | ... | ... |