Created
April 16, 2018 23:11
-
-
Save jdc-cunningham/52290f2b6238ea2274d5ba7cee78dabc to your computer and use it in GitHub Desktop.
retrieve key from memcache
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 | |
// memcache test | |
$server = 'localhost'; | |
if (!empty($_REQUEST['server'])) { | |
$server = $_REQUEST['server']; | |
} | |
$memcache = new Memcache; | |
$isMemcacheAvailable = @$memcache->connect($server); | |
// check memcache | |
if ($isMemcacheAvailable) { | |
// get key object from memcache | |
$user_key_encoded = $memcache->get($name);// ... get it out of the session ... | |
$user_key = Key::loadFromAsciiSafeString($user_key_encoded); | |
} | |
else { | |
echo "memcache not available"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment