Skip to content

Instantly share code, notes, and snippets.

@miteshmap
Last active March 7, 2016 09:19
Show Gist options
  • Select an option

  • Save miteshmap/f185eb2400344a574940 to your computer and use it in GitHub Desktop.

Select an option

Save miteshmap/f185eb2400344a574940 to your computer and use it in GitHub Desktop.
<?php
function redis_set() {
$backend = new Redis_Cache('cache_sweepstakes');
$backend->set('sweepstakes:63:1', 100, CACHE_PERMANENT);
dpm($backend);
return '';
}
function redis_get() {
$backend = new Redis_Cache('cache_sweepstakes');
//$backend->clear('sweepstakes:63:1');
$old_items = $backend->get('sweepstakes:63:1');
$backend->set('sweepstakes:63:1', (int) $old_items->data + 1, CACHE_PERMANENT);
$new_items = $backend->get('sweepstakes:63');
dpm($old_items);
dpm($new_items);
return '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment