swayok / alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea
MIT License
169 stars 26 forks source link

Invalid key "|laravel|a2fbc43097ae717d59c40f85ec4309da". Valid filenames must match [a-zA-Z0-9_\.! ]. #5

Closed NikolayMurha closed 5 years ago

NikolayMurha commented 5 years ago

Hello.

I have multiply cache drivers. File and redis. I have error when I set default cache driver to redis and try to put data to file store after redis store.

For example.

 Cache::store('redis')->put('bar', 'baz', 10);
 Cache::store('file')->put('bar', 'baz', 10);

On the first call AlternativeCacheStore::$hierarchySeparator defined as '|' according to redis store. And this value is invalid for file store.

https://github.com/swayok/alternative-laravel-cache/blob/master/src/AlternativeLaravelCache/Core/AlternativeCacheStore.php#L106

In my opinion, this is a bug, and hierarchySeparator must be related to current cache store (wrappedConnection).

Thanks.

swayok commented 5 years ago

Thank you for the pull request. I've also reviewed all stores and fixed several issues - review 5.4.4 release for details. Now it should be more stable for complicated situations.