laravel/framework — pull request #2082 by awellis13 (2013-08-12 19:50:20+00:00)
Title: Adding namespace fix.

Hello,

While working with Redis we ran into an edge case with namespaced class names as keys.

For example:

````
Cache::add(get_called_class().':'.$id, 'foo', 10);
````

That would use `Metadata\Song:29` as the key. So we have a Redis key of `laravel:Metadata\Song:29`. When going to retrieve this data Redis would randomly send back the wrong data. I personally do not know the internals of Redis well enough to explain why this happens.

I do know that doing the following fixed the issue:

````
Cache::add(str_replace('\\', ':', get_called_class()).':'.$id, 'foo', 10);
````

So I propose we just add a helper method to `RedisStore` to do this automatically.

Regards,
Andrew