mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-23 02:17:05 +08:00
This commit is contained in:
@@ -3729,9 +3729,12 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
$vid = (int) $vid;
|
$vid = (int) $vid;
|
||||||
|
|
||||||
// first of all, check if we should be using cache and whether the field
|
// first of all, check if we should be using cache and whether the field
|
||||||
// required is already cached
|
// required is already cached. NB: use isset() rather than the generic
|
||||||
if ($use_cache && ($cachedValue = self::returnCachedContent(self::$fieldLevelsInVillageSearchCache, $vid.$fieldType)) && !is_null($cachedValue)) {
|
// returnCachedContent(), which treats a cached level of 0 as "empty" and
|
||||||
return $cachedValue;
|
// re-queries it on every call — buildings the village does not own
|
||||||
|
// (level 0, very common) would otherwise never be cached.
|
||||||
|
if ($use_cache && isset(self::$fieldLevelsInVillageSearchCache[$vid.$fieldType])) {
|
||||||
|
return self::$fieldLevelsInVillageSearchCache[$vid.$fieldType];
|
||||||
}
|
}
|
||||||
|
|
||||||
// $fieldType can be both, integer and string, to be used in the IN statement,
|
// $fieldType can be both, integer and string, to be used in the IN statement,
|
||||||
|
|||||||
Reference in New Issue
Block a user