hypixel-php
hypixel-php copied to clipboard
Fix guild cache when requesting guild through UUID or name and add support for PHP 8
The method CacheUtil::isExpired
compares timestamps in order to validate if a timestamp is older than allowed, defined by a given cache time. Both the timestamp and cache time should be in milliseconds, but are given in seconds, therefore always yielding true
as a result, breaking the caching mechanism. Additionally, support for PHP 8 is added in composer.json.
By the way @Plancke, don't forget to add the label 'hacktoberfest' to this repository for some Hacktoberfest goodness 😉
There are a couple more calls to that method in the Mongo handler as well, afaik all timestamps in cached data are seconds so those are probably also non-functioning. Though with how I check the existing guild's collection first before doing this byName/byPlayer lookup it's probably not impacted.
Fair enough, I don't use that handler myself so I've missed that. I'll look into it later!