-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache data presented as String and not Array #55
Comments
I think might have solved this. |
I am able to read code, but quite poor at writing so if this is wrong can someone please correct me. I modified line 64 in FileSystemCache.php from and it "seems" to be working. |
It actually looks like a mistake in the library itself //returns a summoner's id
public function getSummonerId($name) {
$name = strtolower($name);
$summoner = $this->getSummonerByName($name);
if (self::DECODE_ENABLED) {
return $summoner[$name]['id'];
}
else {
$summoner = json_decode($summoner, true);
return $summoner[$name]['id'];
}
} the if and else should probably be reversed //returns a summoner's id
public function getSummonerId($name) {
$name = strtolower($name);
$summoner = $this->getSummonerByName($name);
if (!self::DECODE_ENABLED) {
return $summoner[$name]['id'];
}
else {
$summoner = json_decode($summoner, true);
return $summoner[$name]['id'];
}
} Does that fix the issue instead of having to add your own true? |
Just testing |
Let me know if that fixes it, I will patch the library :) |
That seems to be working, i will have to play around some more as the site is still being created an a lot of stuff doesn't currently work. |
Getting the same issue on
|
I really need to sit down one of these days and go through a bunch of fixes, it hasn't been well thought out lately. I haven't had the time to do everything right. It shouldn't need DECODE_ENABLED checks anywhere. It's done in request(). All those other ones should be redundant. But if it's not working right, I need to really take a deeper look. |
honestly, it could just be me.. |
it could be, but I haven't had the time to maintain this library as well I should lately. I am looking through it and it's me quickly patching stuff and not really fully thinking about the design and structure. Even if it's just you, I need to sit down for a day and just clean the whole thing up. |
Is there any way i would be able to assist you with this? |
I appreciate the offer, if you want to look through and see what you think is wrong, how you would change it, I'm always open to help and ideas |
I also noticed that. It would look like this: if (self::DECODE_ENABLED) {
return json_decode($result, true);
}
return $result; |
I apologies firstly as i am quite new to JSON
When i run the following line the first time with DECODE_ENABLED = TRUE;
$getGame = $testCache->getCurrentGame($summoner_id,OC1);
var_dump ($getGame);
It returns an array, but if i go and refresh the page it will return it as a string.
If i do the same thing again with DECODE_ENABLED = FALSE;
it returns a string both times.
Am i missing an option to decode from cache somewhere or am i making a silly mistake?
The text was updated successfully, but these errors were encountered: