Created
December 25, 2011 00:12
-
-
Save drewgillson/1518544 to your computer and use it in GitHub Desktop.
Redis for Tinybrick Lightspeed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 'redis': | |
try { | |
require_once('lib/Credis/Client.php'); | |
require_once('lib/Zend/Cache/Backend.php'); | |
require_once('lib/Zend/Cache/Backend/Interface.php'); | |
require_once('lib/Zend/Cache/Backend/ExtendedInterface.php'); | |
require_once('app/code/core/Zend/Cache/Backend/Redis.php'); | |
self::$cacheEngine = 'redis'; | |
$options = array(); | |
foreach($child2->backend_options as $el){ | |
$options['server'] = (string)$el->server; | |
$options['port'] = (int)$el->port; | |
$options['database'] = (int)$el->database; | |
$options['timeout'] = (int)$el->timeout; | |
$options['force_standalone'] = (int)$el->force_standalone; | |
$options['automatic_cleaning_factor'] = (int)$el->automatic_cleaning_factor; | |
} | |
self::$cacheData['server'] = new Zend_Cache_Backend_Redis($options); | |
} | |
catch (Exception $e) { | |
die('Redis can not be used as the backend for Lightspeed. Check local.xml for proper configuration.'); | |
} | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment