mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-06-20 05:45:49 +00:00
WEB: Don't make the cache database depend on the hostname
This avoids having two caches when accessing the website with or without a www and this is also more robust. Make use of the DEV_SERVER constant and allow to enable it by setting an environment variable.
This commit is contained in:
1 parent
dcbbef22a7
commit
85bbf617bb
2 files changed
+11
-3
No files matched your search
@@ -17,7 +17,7 @@ abstract class BasicModel
|
||||
if (is_null(self::$cache)) {
|
||||
try {
|
||||
$driver = extension_loaded('redis') ? 'redis' : 'predis';
|
||||
$database = $_SERVER['HTTP_HOST'] === 'www.scummvm.org' ? 8 : 7;
|
||||
$database = DEV_SERVER ? 7 : 8;
|
||||
$config = extension_loaded('redis')
|
||||
? new RedisConfig(['database' => $database])
|
||||
: new PredisConfig(['database' => $database]);
|
||||
|
||||
Reference in new issue
Block a user