Created
April 2, 2019 18:58
-
-
Save ianlintner-wf/c9549889dc5175489fa59355154cf917 to your computer and use it in GitHub Desktop.
Redis custom cache for simple saml cache clear all
This file contains 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
<?php | |
$config = \SimpleSAML_Configuration::getInstance(); | |
$red = new \SimpleSAML\Store\Redis(); | |
$conf = array( | |
'host' => $config->getString('store.redis.host', 'localhost'), | |
'port' => $config->getInteger('store.redis.port', 6379), | |
'prefix' => $config->getString('store.redis.prefix', 'SimpleSAMLphp'), | |
'scheme' => 'tcp', | |
); | |
if (!empty($config->getString('store.redis.password',''))) { | |
$conf['password'] = $config->getString('store.redis.password',''); | |
} | |
/*** | |
* @var \Redis_Client | |
*/ | |
$redis = $red->get_client($conf); | |
$redis->_prefix( | |
$config->getString('store.redis.prefix', 'SimpleSAMLphp')); | |
if (!empty($config->getString('store.redis.password',''))) { | |
$redis->auth($config->getString('store.redis.password','')); | |
} | |
$redis->flushAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment