Commit 37da299d2ae05ab323486095ad3769f47b356d6d
1 parent
1e225096
fix for vhost-bug in configcache
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5585 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
6 additions
and
4 deletions
config/dmsDefaults.php
| @@ -358,11 +358,13 @@ class KTInit { | @@ -358,11 +358,13 @@ class KTInit { | ||
| 358 | if (file_exists(KT_DIR . "/config/cache-path")) { | 358 | if (file_exists(KT_DIR . "/config/cache-path")) { |
| 359 | $store_cache = true; | 359 | $store_cache = true; |
| 360 | $user = KTLegacyLog::running_user(); | 360 | $user = KTLegacyLog::running_user(); |
| 361 | - $cache_file = trim(file_get_contents(KT_DIR . "/config/cache-path")) . '/configcache' . $user; | ||
| 362 | - if (!KTUtil::isAbsolutePath($cache_file)) { $cache_file = sprintf("%s/%s", KT_DIR, $cache_file); } | ||
| 363 | - $config_file = trim(file_get_contents(KT_DIR . "/config/config-path")); | 361 | + // handle vhosts. |
| 362 | + $truehost = KTUtil::arrayGet($_SERVER, 'HTTP_HOST', 'default'); | ||
| 363 | + $cache_file = trim(file_get_contents(KT_DIR . "/config/cache-path")) . '/configcache' . $user . $truehost; | ||
| 364 | + if (!KTUtil::isAbsolutePath($cache_file)) { $cache_file = sprintf("%s/%s", KT_DIR, $cache_file); } | ||
| 365 | + $config_file = trim(file_get_contents(KT_DIR . "/config/config-path")); | ||
| 364 | if (!KTUtil::isAbsolutePath($config_file)) { $config_file = sprintf("%s/%s", KT_DIR, $config_file); } | 366 | if (!KTUtil::isAbsolutePath($config_file)) { $config_file = sprintf("%s/%s", KT_DIR, $config_file); } |
| 365 | - | 367 | + |
| 366 | $exists = file_exists($cache_file); | 368 | $exists = file_exists($cache_file); |
| 367 | if ($exists) { | 369 | if ($exists) { |
| 368 | $cachestat = stat($cache_file); | 370 | $cachestat = stat($cache_file); |