diff --git a/endpoints/achievement/achievement.php b/endpoints/achievement/achievement.php index 6fb270a1..7ab7fb86 100644 --- a/endpoints/achievement/achievement.php +++ b/endpoints/achievement/achievement.php @@ -21,7 +21,7 @@ class AchievementBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'achievement'; protected string $pageName = 'achievement'; diff --git a/endpoints/achievements/achievements.php b/endpoints/achievements/achievements.php index 70fe460e..98c2676a 100644 --- a/endpoints/achievements/achievements.php +++ b/endpoints/achievements/achievements.php @@ -11,7 +11,7 @@ class AchievementsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ACHIEVEMENT; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'achievements'; protected string $pageName = 'achievements'; diff --git a/endpoints/areatrigger/areatrigger.php b/endpoints/areatrigger/areatrigger.php index b0ce07ca..edd991cf 100644 --- a/endpoints/areatrigger/areatrigger.php +++ b/endpoints/areatrigger/areatrigger.php @@ -10,7 +10,7 @@ class AreatriggerBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected int $requiredUserGroup = U_GROUP_STAFF; protected string $template = 'detail-page-generic'; diff --git a/endpoints/areatriggers/areatriggers.php b/endpoints/areatriggers/areatriggers.php index 04b06d46..55ffa720 100644 --- a/endpoints/areatriggers/areatriggers.php +++ b/endpoints/areatriggers/areatriggers.php @@ -11,7 +11,7 @@ class AreatriggersBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::AREATRIGGER; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected int $requiredUserGroup = U_GROUP_STAFF; protected string $template = 'areatriggers'; diff --git a/endpoints/class/class.php b/endpoints/class/class.php index f983c679..b7ce50d7 100644 --- a/endpoints/class/class.php +++ b/endpoints/class/class.php @@ -12,7 +12,7 @@ class ClassBaseResponse extends TemplateResponse implements ICache private const TC_CLASS_IDS = [null, 8, 3, 1, 5, 4, 9, 6, 2, 7, null, 0]; // see TalentCalc.js - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'class'; diff --git a/endpoints/classes/classes.php b/endpoints/classes/classes.php index 3e7251a0..46959c9f 100644 --- a/endpoints/classes/classes.php +++ b/endpoints/classes/classes.php @@ -11,7 +11,7 @@ class ClassesBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::CHR_CLASS; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'classes'; diff --git a/endpoints/currencies/currencies.php b/endpoints/currencies/currencies.php index 0a5aec25..931cd885 100644 --- a/endpoints/currencies/currencies.php +++ b/endpoints/currencies/currencies.php @@ -11,7 +11,7 @@ class CurrenciesBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::CURRENCY; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'currencies'; diff --git a/endpoints/currency/currency.php b/endpoints/currency/currency.php index cc65b9e8..346a71bd 100644 --- a/endpoints/currency/currency.php +++ b/endpoints/currency/currency.php @@ -10,7 +10,7 @@ class CurrencyBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'currency'; diff --git a/endpoints/emote/emote.php b/endpoints/emote/emote.php index 317d0130..b5b64f9e 100644 --- a/endpoints/emote/emote.php +++ b/endpoints/emote/emote.php @@ -10,7 +10,7 @@ class EmoteBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'emote'; diff --git a/endpoints/emotes/emotes.php b/endpoints/emotes/emotes.php index f3103995..b303aa5f 100644 --- a/endpoints/emotes/emotes.php +++ b/endpoints/emotes/emotes.php @@ -10,7 +10,7 @@ class EmotesBaseResponse extends TemplateResponse implements ICache { use TrListPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected int $type = Type::EMOTE; protected string $template = 'list-page-generic'; diff --git a/endpoints/enchantment/enchantment.php b/endpoints/enchantment/enchantment.php index b836cbd1..52a38cc6 100644 --- a/endpoints/enchantment/enchantment.php +++ b/endpoints/enchantment/enchantment.php @@ -10,7 +10,7 @@ class EnchantmentBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'enchantment'; protected string $pageName = 'enchantment'; diff --git a/endpoints/enchantments/enchantments.php b/endpoints/enchantments/enchantments.php index 1d35f2b2..2ca90fdb 100644 --- a/endpoints/enchantments/enchantments.php +++ b/endpoints/enchantments/enchantments.php @@ -11,7 +11,7 @@ class EnchantmentsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ENCHANTMENT; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'enchantments'; protected string $pageName = 'enchantments'; diff --git a/endpoints/event/event.php b/endpoints/event/event.php index 71a722e6..ac3b5f31 100644 --- a/endpoints/event/event.php +++ b/endpoints/event/event.php @@ -10,7 +10,7 @@ class EventBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'event'; diff --git a/endpoints/events/events.php b/endpoints/events/events.php index 2ae4a9b9..c724234f 100644 --- a/endpoints/events/events.php +++ b/endpoints/events/events.php @@ -11,7 +11,7 @@ class EventsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::WORLDEVENT; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'events'; diff --git a/endpoints/faction/faction.php b/endpoints/faction/faction.php index 12ce8592..934a191d 100644 --- a/endpoints/faction/faction.php +++ b/endpoints/faction/faction.php @@ -10,7 +10,7 @@ class FactionBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'faction'; diff --git a/endpoints/factions/factions.php b/endpoints/factions/factions.php index db3caeb6..bf21c587 100644 --- a/endpoints/factions/factions.php +++ b/endpoints/factions/factions.php @@ -11,7 +11,7 @@ class FactionsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::FACTION; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'factions'; diff --git a/endpoints/guide/guide.php b/endpoints/guide/guide.php index 90de7eb8..9bf5836a 100644 --- a/endpoints/guide/guide.php +++ b/endpoints/guide/guide.php @@ -10,7 +10,7 @@ class GuideBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'guide'; diff --git a/endpoints/guides/guides.php b/endpoints/guides/guides.php index 9c0db0ee..5216111c 100644 --- a/endpoints/guides/guides.php +++ b/endpoints/guides/guides.php @@ -10,7 +10,7 @@ class GuidesBaseResponse extends TemplateResponse // implements ICache { use TrListPage/* , TrCache */; - // protected int $cacheType = CACHE_TYPE_PAGE; // really do? cache would need to be destroyed externally with each guide status update + // protected int $cacheType = CACHE_TYPE_LIST_PAGE; // really do? cache would need to be destroyed externally with each guide status update protected int $type = Type::GUIDE; protected string $template = 'list-page-generic'; diff --git a/endpoints/icon/icon.php b/endpoints/icon/icon.php index 2a67b53e..e57236c2 100644 --- a/endpoints/icon/icon.php +++ b/endpoints/icon/icon.php @@ -10,7 +10,7 @@ class IconBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'icon'; protected string $pageName = 'icon'; diff --git a/endpoints/icons/icons.php b/endpoints/icons/icons.php index 7613240e..7b2cf323 100644 --- a/endpoints/icons/icons.php +++ b/endpoints/icons/icons.php @@ -11,7 +11,7 @@ class IconsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ICON; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'icons'; protected string $pageName = 'icons'; diff --git a/endpoints/item/item.php b/endpoints/item/item.php index 2e5880fe..03f5da42 100644 --- a/endpoints/item/item.php +++ b/endpoints/item/item.php @@ -10,7 +10,7 @@ class ItemBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'item'; protected string $pageName = 'item'; diff --git a/endpoints/item/item_xml.php b/endpoints/item/item_xml.php index 5599be5c..ee71200b 100644 --- a/endpoints/item/item_xml.php +++ b/endpoints/item/item_xml.php @@ -220,8 +220,7 @@ class ItemXmlResponse extends TextResponse implements ICache { return array( $this->type, // DBType - $this->typeId, // DBTypeId - -1, // category + $this->typeId, // DBTypeId/category -1, // staff mask (content does not diff) '' // misc (unused) ); diff --git a/endpoints/items/items.php b/endpoints/items/items.php index 21aff287..442f0c08 100644 --- a/endpoints/items/items.php +++ b/endpoints/items/items.php @@ -11,7 +11,7 @@ class ItemsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ITEM; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'items'; protected string $pageName = 'items'; diff --git a/endpoints/itemset/itemset.php b/endpoints/itemset/itemset.php index 2cd46422..317637b3 100644 --- a/endpoints/itemset/itemset.php +++ b/endpoints/itemset/itemset.php @@ -10,7 +10,7 @@ class ItemsetBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'itemset'; protected string $pageName = 'itemset'; diff --git a/endpoints/itemsets/itemsets.php b/endpoints/itemsets/itemsets.php index a0acd354..d1905239 100644 --- a/endpoints/itemsets/itemsets.php +++ b/endpoints/itemsets/itemsets.php @@ -11,7 +11,7 @@ class ItemsetsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ITEMSET; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'itemsets'; protected string $pageName = 'itemsets'; diff --git a/endpoints/mail/mail.php b/endpoints/mail/mail.php index 5179b6e8..73bc132e 100644 --- a/endpoints/mail/mail.php +++ b/endpoints/mail/mail.php @@ -10,7 +10,7 @@ class MailBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'mail'; diff --git a/endpoints/mails/mails.php b/endpoints/mails/mails.php index e892948f..0e7e4c60 100644 --- a/endpoints/mails/mails.php +++ b/endpoints/mails/mails.php @@ -11,7 +11,7 @@ class MailsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::MAIL; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'mails'; diff --git a/endpoints/maps/maps.php b/endpoints/maps/maps.php index de62e4bc..0f99f470 100644 --- a/endpoints/maps/maps.php +++ b/endpoints/maps/maps.php @@ -8,8 +8,6 @@ if (!defined('AOWOW_REVISION')) class MapsBaseResponse extends TemplateResponse { - protected int $cacheType = CACHE_TYPE_PAGE; - protected string $template = 'maps'; protected string $pageName = 'maps'; protected ?int $activeTab = parent::TAB_TOOLS; diff --git a/endpoints/npc/npc.php b/endpoints/npc/npc.php index c911aee7..ba489abc 100644 --- a/endpoints/npc/npc.php +++ b/endpoints/npc/npc.php @@ -10,7 +10,7 @@ class NpcBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'npc'; protected string $pageName = 'npc'; diff --git a/endpoints/npcs/npcs.php b/endpoints/npcs/npcs.php index 1bd05bfb..5a325144 100644 --- a/endpoints/npcs/npcs.php +++ b/endpoints/npcs/npcs.php @@ -11,7 +11,7 @@ class NpcsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::NPC; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'npcs'; protected string $pageName = 'npcs'; diff --git a/endpoints/object/object.php b/endpoints/object/object.php index 6ebfbe6f..de643a4d 100644 --- a/endpoints/object/object.php +++ b/endpoints/object/object.php @@ -10,7 +10,7 @@ class ObjectBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'object'; protected string $pageName = 'object'; diff --git a/endpoints/objects/objects.php b/endpoints/objects/objects.php index e08e5782..00b3d463 100644 --- a/endpoints/objects/objects.php +++ b/endpoints/objects/objects.php @@ -11,7 +11,7 @@ class ObjectsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::OBJECT; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'objects'; protected string $pageName = 'objects'; diff --git a/endpoints/pet/pet.php b/endpoints/pet/pet.php index 30d0db14..63460f3e 100644 --- a/endpoints/pet/pet.php +++ b/endpoints/pet/pet.php @@ -10,7 +10,7 @@ class PetBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'pet'; diff --git a/endpoints/pets/pets.php b/endpoints/pets/pets.php index 714bd151..7565805f 100644 --- a/endpoints/pets/pets.php +++ b/endpoints/pets/pets.php @@ -11,7 +11,7 @@ class PetsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::PET; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'pets'; diff --git a/endpoints/quest/quest.php b/endpoints/quest/quest.php index 68a51839..a18c5d7e 100644 --- a/endpoints/quest/quest.php +++ b/endpoints/quest/quest.php @@ -10,7 +10,7 @@ class QuestBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'quest'; protected string $pageName = 'quest'; diff --git a/endpoints/quests/quests.php b/endpoints/quests/quests.php index fb4d944f..78fac93e 100644 --- a/endpoints/quests/quests.php +++ b/endpoints/quests/quests.php @@ -32,7 +32,7 @@ class QuestsBaseResponse extends TemplateResponse implements ICache ); protected int $type = Type::QUEST; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'quests'; protected string $pageName = 'quests'; diff --git a/endpoints/race/race.php b/endpoints/race/race.php index 6da89fc8..220bf369 100644 --- a/endpoints/race/race.php +++ b/endpoints/race/race.php @@ -16,7 +16,7 @@ class RaceBaseResponse extends TemplateResponse implements ICache [7952, 33554], null, [16264, 33557], [17584, 33657] ); - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'race'; diff --git a/endpoints/races/races.php b/endpoints/races/races.php index e5c67324..b9ae8ecb 100644 --- a/endpoints/races/races.php +++ b/endpoints/races/races.php @@ -11,7 +11,7 @@ class RacesBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::CHR_RACE; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'races'; diff --git a/endpoints/skill/skill.php b/endpoints/skill/skill.php index 005bc0cf..d68936e0 100644 --- a/endpoints/skill/skill.php +++ b/endpoints/skill/skill.php @@ -10,7 +10,7 @@ class SkillBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'skill'; diff --git a/endpoints/skills/skills.php b/endpoints/skills/skills.php index f6275491..f60076d7 100644 --- a/endpoints/skills/skills.php +++ b/endpoints/skills/skills.php @@ -11,7 +11,7 @@ class SkillsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::SKILL; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'skills'; diff --git a/endpoints/sound/sound.php b/endpoints/sound/sound.php index 6207cf2a..e2512285 100644 --- a/endpoints/sound/sound.php +++ b/endpoints/sound/sound.php @@ -10,7 +10,7 @@ class SoundBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'sound'; protected string $pageName = 'sound'; diff --git a/endpoints/sounds/sounds.php b/endpoints/sounds/sounds.php index 3ed6eaa6..9132c40f 100644 --- a/endpoints/sounds/sounds.php +++ b/endpoints/sounds/sounds.php @@ -11,7 +11,7 @@ class SoundsBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::SOUND; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'sounds'; protected string $pageName = 'sounds'; diff --git a/endpoints/spell/spell.php b/endpoints/spell/spell.php index c96a1739..abb5a783 100644 --- a/endpoints/spell/spell.php +++ b/endpoints/spell/spell.php @@ -16,7 +16,7 @@ class SpellBaseResponse extends TemplateResponse implements ICache SPELL_AURA_MOD_IGNORE_SHAPESHIFT, SPELL_AURA_PERIODIC_HASTE, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, SPELL_AURA_MOD_DAMAGE_FROM_CASTER, SPELL_AURA_ADD_TARGET_TRIGGER, /* SPELL_AURA_DUMMY ? */]; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'spell'; protected string $pageName = 'spell'; diff --git a/endpoints/spells/spells.php b/endpoints/spells/spells.php index db58d8e9..fa6c4533 100644 --- a/endpoints/spells/spells.php +++ b/endpoints/spells/spells.php @@ -26,7 +26,7 @@ class SpellsBaseResponse extends TemplateResponse implements ICache ); protected int $type = Type::SPELL; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'spells'; protected string $pageName = 'spells'; diff --git a/endpoints/title/title.php b/endpoints/title/title.php index a2805040..7bc4ae01 100644 --- a/endpoints/title/title.php +++ b/endpoints/title/title.php @@ -10,7 +10,7 @@ class TitleBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected array $breadcrumb = [0, 10]; diff --git a/endpoints/titles/titles.php b/endpoints/titles/titles.php index a9b916d6..61e4dba3 100644 --- a/endpoints/titles/titles.php +++ b/endpoints/titles/titles.php @@ -11,7 +11,7 @@ class TitlesBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::TITLE; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'titles'; diff --git a/endpoints/zone/zone.php b/endpoints/zone/zone.php index 2039efc9..a26ddbab 100644 --- a/endpoints/zone/zone.php +++ b/endpoints/zone/zone.php @@ -10,7 +10,7 @@ class ZoneBaseResponse extends TemplateResponse implements ICache { use TrDetailPage, TrCache; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_DETAIL_PAGE; protected string $template = 'detail-page-generic'; protected string $pageName = 'zone'; diff --git a/endpoints/zones/zones.php b/endpoints/zones/zones.php index 77247254..925486fc 100644 --- a/endpoints/zones/zones.php +++ b/endpoints/zones/zones.php @@ -11,7 +11,7 @@ class ZonesBaseResponse extends TemplateResponse implements ICache use TrListPage, TrCache; protected int $type = Type::ZONE; - protected int $cacheType = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_LIST_PAGE; protected string $template = 'list-page-generic'; protected string $pageName = 'zones'; diff --git a/includes/components/response/baseresponse.class.php b/includes/components/response/baseresponse.class.php index 99d3a8dd..137741d8 100644 --- a/includes/components/response/baseresponse.class.php +++ b/includes/components/response/baseresponse.class.php @@ -201,9 +201,9 @@ trait TrCache { $this->initCache(); - // type+typeId+catg; 3+6+10 + // type+typeId/catg+mode; 3+10+1 $cKey = $this->formatCacheKey(); - $cKey[2] = substr($cKey[2], 0, 19); + $cKey[2] = substr($cKey[2], 0, 13); if ($modeMask & CACHE_MODE_MEMCACHED) foreach ($this->memcached()?->getAllKeys() ?? [] as $k) @@ -265,29 +265,27 @@ trait TrCache // https://stackoverflow.com/questions/466521 private function formatCacheKey() : array { - [$dbType, $dbTypeId, $category, $staffMask, $miscInfo] = $this->getCacheKeyComponents(); + [$dbType, $dbTypeIdOrCat, $staffMask, $miscInfo] = $this->getCacheKeyComponents(); $fileKey = ''; // DBType: 3 $fileKey .= str_pad(dechex($dbType & 0xFFF), 3, 0, STR_PAD_LEFT); - // DBTypeId: 6 - $fileKey .= str_pad(dechex($dbTypeId & 0xFFFFFF), 6, 0, STR_PAD_LEFT); - // category: (2+4+4) - $fileKey .= str_pad(dechex($category & 0xFFFFFFFFFF), 2+4+4, 0, STR_PAD_LEFT); + // DBTypeId: 6 / category: (2+4+4) + $fileKey .= str_pad(dechex($dbTypeIdOrCat & 0xFFFFFFFFFF), 2+4+4, 0, STR_PAD_LEFT); // cacheType: 1 $fileKey .= str_pad(dechex($this->_cacheType & 0xF), 1, 0, STR_PAD_LEFT); // localeId: 2, $fileKey .= str_pad(dechex(Lang::getLocale()->value & 0xFF), 2, 0, STR_PAD_LEFT); // staff mask: 4 $fileKey .= str_pad(dechex($staffMask & 0xFFFFFFFF), 4, 0, STR_PAD_LEFT); - // optioal: miscInfo + // optional: miscInfo if ($miscInfo) $fileKey .= '-'.$miscInfo; // topDir, 2ndDir, file return array( str_pad(dechex($dbType & 0xFF), 2, 0, STR_PAD_LEFT), - str_pad(dechex(($dbTypeId > 0 ? $dbTypeId : $category) & 0xFF), 2, 0, STR_PAD_LEFT), + str_pad(dechex(($dbTypeIdOrCat) & 0xFF), 2, 0, STR_PAD_LEFT), $fileKey ); } @@ -327,8 +325,7 @@ trait TrSearch { return array( -1, // DBType - -1, // DBTypeId - $this->searchMask, // category + $this->searchMask, // DBTypeId/category User::$groups, // staff mask md5($this->query) // misc (here search query) ); diff --git a/includes/components/response/templateresponse.class.php b/includes/components/response/templateresponse.class.php index bc5ff8f6..d5050ad0 100644 --- a/includes/components/response/templateresponse.class.php +++ b/includes/components/response/templateresponse.class.php @@ -21,8 +21,7 @@ trait TrDetailPage { return array( $this->type, // DBType - $this->typeId, // DBTypeId - -1, // category + $this->typeId, // DBTypeId/category User::$groups, // staff mask '' // misc (here unused) ); @@ -54,8 +53,7 @@ trait TrListPage return array( $this->type, // DBType - -1, // DBTypeId - $catg ?? -1, // category + $catg ?? -1, // DBTypeId/category User::$groups, // staff mask $misc ?? '' // misc (here filter) ); diff --git a/includes/components/response/textresponse.class.php b/includes/components/response/textresponse.class.php index aef1843d..7885af27 100644 --- a/includes/components/response/textresponse.class.php +++ b/includes/components/response/textresponse.class.php @@ -14,8 +14,7 @@ trait TrTooltip { $key = array( $this->type, // DBType - $this->typeId, // DBTypeId - -1, // category + $this->typeId, // DBTypeId/category User::$groups, // staff mask '' // misc (here tooltip) ); diff --git a/includes/defines.php b/includes/defines.php index e73a84d0..5084912c 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -41,6 +41,8 @@ define('CACHE_TYPE_PAGE', 1); define('CACHE_TYPE_TOOLTIP', 2); define('CACHE_TYPE_SEARCH', 3); define('CACHE_TYPE_XML', 4); // only used by items +define('CACHE_TYPE_LIST_PAGE', 5); +define('CACHE_TYPE_DETAIL_PAGE', 6); define('CACHE_MODE_FILECACHE', 0x1); define('CACHE_MODE_MEMCACHED', 0x2); diff --git a/includes/kernel.php b/includes/kernel.php index 809460c9..00a4414d 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -6,7 +6,7 @@ mb_internal_encoding('UTF-8'); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR); -define('AOWOW_REVISION', 41); +define('AOWOW_REVISION', 42); define('OS_WIN', substr(PHP_OS, 0, 3) == 'WIN'); // OS_WIN as per compile info of php define('CLI', PHP_SAPI === 'cli'); define('CLI_HAS_E', CLI && // WIN10 and later usually support ANSI escape sequences