You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.
The driver names like Memcached or Redis are conflicting with the php corresponding classes and you need to alias them when importing which is annoying. Ideally they should be suffixed by Driver because Cache "bugs" with XCache or WinCache (XCacheCache ...)
It uses Psr\Cache which was not accepted AFAIK so the classes need to be moved somewhere else like in the package itself.
I still don't see the purpose of wrapping all values inside an object (the cache Item), it is a big performance overhead.
You cannot know if an item is present or not. It should be possible to pass a $default param to the get function to know if the cache entry value is null or if it is null because not present in the cache.
It's still not possible to inject a \Memcached driver in the Memcached class or a \Redis driver in the Redis class for example to share the same instance between Cache and Session.
I'm not really thrilled with the implementation, but I will point out that wrapping values inside an object solves the issue of "is null or is not present" - the cache handler ALWAYS returns a cache object - and it will set a boolean flag to note if the value has been found or not.
Returning a cache item allows for the ability to add the cache meta data to the information returned[hits, misses, etc].
Moreover, it does allow for passing cached data around without making many copies..ie objects are always passed by reference.
I personally think that in addition to passing a cache item back, data should be stored as a cache item to begin with.
As for sessions, the Memcached session driver doesn't use a driver at all - it simply defaults to using the built in php functions... Again, not thrilled about this direction, however I think a much simpler solution is to create a CacheEngine class for the Session and allow the session driver to use any Joomla Cache method without requiring special code logic].
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
There are a few issues with the Cache package :
Memcached
orRedis
are conflicting with the php corresponding classes and you need to alias them when importing which is annoying. Ideally they should be suffixed byDriver
becauseCache
"bugs" with XCache or WinCache (XCacheCache ...)Psr\Cache
which was not accepted AFAIK so the classes need to be moved somewhere else like in the package itself.Item
), it is a big performance overhead.$default
param to theget
function to know if the cache entry value is null or if it is null because not present in the cache.ttl
parameter https://github.com/joomla/joomla-framework/blob/staging/src/Joomla/Cache/Cache.php#L42but this is used in some drivers and not in some others.
Used in Apc https://github.com/joomla/joomla-framework/blob/staging/src/Joomla/Cache/Apc.php#L129 but not used here : https://github.com/joomla/joomla-framework/blob/staging/src/Joomla/Cache/XCache.php#L97
\Memcached
driver in the Memcached class or a\Redis
driver in the Redis class for example to share the same instance between Cache and Session.Why not using Doctrine which has already more drivers and fixed most of these issues ?
https://github.com/doctrine/cache/tree/master/lib/Doctrine/Common/Cache
The text was updated successfully, but these errors were encountered: