Simple-PHP-Cache icon indicating copy to clipboard operation
Simple-PHP-Cache copied to clipboard

Cache stores only ONE value

Open mariommoreno opened this issue 8 years ago • 4 comments

When I call store(), only the first value is stored. It happens in a AWS instance, but not in my XAMPP.

I can clear the cache and write again a different data, but only the first one.

Any Idea?

mariommoreno avatar Oct 27 '15 12:10 mariommoreno

Same problem here, good to see I'm not alone with this one.

MisterJD avatar Mar 16 '16 15:03 MisterJD

May I see your code, while preparing data before store?

bencagri avatar Mar 17 '16 08:03 bencagri

I use the cache system over some php files, each file creates a object of cache with a specific id personal_id = 'asdBns8'; //something like this $c = new Cache($personal_id);

In theory the system should use the same ".cache" file and work with the same cache over the different PHP files, whats the system does with one value in cache. But when I try to store something like this, so a second value: $c->store('user_data', $user_array); $c->store('info', 'Data is submitted');

The complete content in the cache file gets deleted...

And the code before the storing, is nothing special, sometimes a simple MySQL Database Call, sometimes I try to store just a string, like the example above.

MisterJD avatar Mar 17 '16 12:03 MisterJD

Oh wow, I think I fixed my problem...it was a problem with the charset, one php file was not converted to UTF8, what I need. Damn, sometimes it can be so easy...

MisterJD avatar Mar 17 '16 12:03 MisterJD