Skip to content

Instantly share code, notes, and snippets.

@emptyhua
Created March 4, 2013 04:07
Show Gist options
  • Save emptyhua/5079839 to your computer and use it in GitHub Desktop.
Save emptyhua/5079839 to your computer and use it in GitHub Desktop.
PHP中注册退出hook
function memcache_lock_clean() {
global $memcache_locks;
$mem = require_memcache();
foreach($memcache_locks as $key=>$v){
$mem->delete('LOCK' . $key);
}
}
register_shutdown_function('memcache_lock_clean');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment