Advertisement
Guest User

Untitled

a guest
May 27th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
  3.  
  4. $memcache = new Memcache();
  5.  
  6. for($i=2;$i<=9;$i++) {
  7. $memcache->addServer("localhost",(int)"1121".$i); // instance n
  8. }
  9. $memcache->set("keyfalse",false);
  10. if ($value=$memcache->get("keyfalse")) echo "pas false > $value";
  11. echo"test keyfalse";
  12. var_dump($memcache->get("keyfalse"));
  13. if ($memcache->get("keyfalse") == false) echo "----double FALSE----";
  14. echo"fin test";
  15. echo"test inexistant";
  16. var_dump($memcache->get("key3"));
  17. if ($memcache->get("key3") == false) echo "----double FALSE----";
  18. echo"fin test";
  19. $memcache->set("key1","value1");
  20. $memcache->set("key2","value2");
  21. if ($value1 = $memcache->get("key1")) echo "pas false key1 > ".$value1;
  22. $aStats = $memcache->getExtendedStats();
  23. //var_dump($aStats);
  24. foreach($aStats as $iInstance=>$oInstance) {
  25. echo $iInstance." -> ".($oInstance ? " pid:".$oInstance["pid"]." ". " Number of items : ".$oInstance["cmd_set"] : "Discon$
  26. echo PHP_EOL;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement