Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: 2.0-RC1
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
I'm currently working on some glue classes to integrate Doctrine 2 into an existing Zend Framework project.
To be able to re-use our caching classes (which use Zend_Cache), I wrote a \Doctrine\Common\Cache\AbstractCache implementation for Zend_Cache:
However Zend_Cache only allows "a-zA-Z0-9_" for cache keys, while Doctrine seems to allow anything, and Doctrine ORM seems to use at lease "\" and "$" for metadata storage ("Entity\Article\Category$CLASSMETADATA").
What do you think is the most elegant way to solve this?
- Should Doctrine also limit the cache key characters?
- How could _encodeId and _decodeId be implemented?
Currently the cached results and queries are saved with an md5 key anyway, so this works out of the box.
The only ones that make problems are metadata cache, which stores "Entity\Article\Category$CLASSMETADATA". As the Doctrine caching layer can be used separate from the other components, it may be a good idea to still allow arbitrary keys and mapping them internally.