Last active
February 25, 2019 13:37
-
-
Save foospidy/85ccd44a12e00d91ecf990e82ed5e033 to your computer and use it in GitHub Desktop.
Example script to reset the value to 0 for all keys in Redis.
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
| <?php | |
| if($redis->connect($GLOBALS['REDIS_HOST'], $GLOBALS['REDIS_PORT'])) { | |
| if($redis->auth($GLOBALS['REDIS_PASSWORD'])) { | |
| $keys = $redis->keys('*'); | |
| foreach($keys as $key) { | |
| $redis->set($key, 0); | |
| } | |
| } else { | |
| error_log('Error authenticating to redis!'); | |
| } | |
| } else { | |
| error_log('Error connecting to redis!'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment