? ? Error

User tests: Successful: Unsuccessful:

avatar WooDzu
WooDzu
26 Sep 2013

Greetings!

I have implemented a cache handler for Redis storage. It uses PHP Redis extension or Predis PEAR package if any of these are available. It also adds 2 global configuration options for Redis Host IP/Socket and Redis Port.

Only had a chance to test on Windows.

References:
Predis: https://github.com/nrk/predis
PHP Redis Extension: https://github.com/nicolasff/phpredis

JoomlaCode Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32099&start=0

(updated by brian with the corrected tracker link)

avatar WooDzu WooDzu - open - 26 Sep 2013
avatar WooDzu
WooDzu - comment - 26 Sep 2013

The port is configurable, it uses 6379 by default if noting is configured in Joomla's Global Configuration.
So this is actually the same like for setting up Memcache(d) handler

avatar elinw
elinw - comment - 26 Sep 2013

Do you also want to send this to the Framework?

avatar WooDzu
WooDzu - comment - 26 Sep 2013

Definitely yes, I'll do a pool request for joomla-framework with unit-tests over the new couple of days.

avatar WooDzu
WooDzu - comment - 9 Oct 2013

Yes, I am aware of that, but is it capable of autoloading classes from PEAR?

I had checked how the other cache handler - Cache_Lite do it. Please take a look here
https://github.com/joomla/joomla-cms/blob/master/libraries/joomla/cache/storage/cachelite.php#L329

avatar dongilbert
dongilbert - comment - 9 Oct 2013

It can handle PEAR classes as well. The Cache_Lite handler was implemented before the PSR-0 compatible auto loader was available in core.

avatar dongilbert
dongilbert - comment - 9 Oct 2013

Oh, and I also noticed this is relying on a PEAR installation of Predis. Is that the only way to get it or is it also available via composer? I almost think we should just do a check to see if the classes exist, and not worry about setting up an auto loader. I'm not sure, maybe someone with more experience with cache (@eddieajau?) can offer their opinion.

avatar eddieajau
eddieajau - comment - 9 Oct 2013

Yeah, let's throw an exception if the dependency is not available.

Just on a side note Don, has FIG sorted out the PSR for Cache yet?

avatar WooDzu
WooDzu - comment - 9 Oct 2013

Ok then. I must've been doing something wrong so it didn't work automatically. Let me spent some more on it.
And yes it is available from composer.

avatar dongilbert
dongilbert - comment - 11 Oct 2013

@eddieajau FIG has not sorted it out yet fully, but it is moving along still. There's talk it might be finalized for a vote by the end of the year.

avatar WooDzu
WooDzu - comment - 14 Oct 2013

How about... to make things easier just check for the extension and ignore Predis completely, like in the pr I've submitted to the framework. Extension is about 20%-30% faster on my laptop, the only reason I added Predis is that I've been using it for a while and it was pretty stable until I switched to the ext.

I think people who search for Performance with Redis won't have any issues with installing (Windows: downloading) the extension.

avatar interfasys
interfasys - comment - 30 Jan 2014

If you decide to implement both predis and phpredis, please make sure you auto-select the fastest one or let us pick :).
In my experience, it's common to have both the PEAR and PECL packages installed at the same time as different apps will connect to Redis using one or the other.

avatar brianteeman brianteeman - change - 8 Aug 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 21 Aug 2014
Status New Pending
avatar nicksavov nicksavov - change - 21 Aug 2014
Labels Removed: ?
avatar zero-24 zero-24 - change - 27 Dec 2014
Status Pending Closed
avatar jissues-bot
jissues-bot - comment - 27 Dec 2014

Set to "closed" on behalf of @zero-24 by The JTracker Application at issues.joomla.org/joomla-cms/2078

avatar jissues-bot jissues-bot - close - 27 Dec 2014
avatar zero-24
zero-24 - comment - 27 Dec 2014

We have allready a Implementation of Redis caching #3615 @WooDzu can you have a look into it and change / update with a PR against staging if needed?

Thanks :smile:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/2078.
avatar jissues-bot jissues-bot - change - 27 Dec 2014
Closed_Date 0000-00-00 00:00:00 2014-12-27 15:42:00

Add a Comment

Login with GitHub to post a comment