コード例 #1
0
 public function __construct()
 {
     // let's make this a singleton
     if (isset($memc)) {
         return $this;
     }
     self::$memc = new Memcache();
     self::$memc->addServer(self::$host);
 }
コード例 #2
0
<?php

require_once "includes/memcache.php";
$memcache = new RR_Memcache();
$callKey = $_REQUEST['callKey'];
$aResponse = array("move" => $memcache->get($callKey));
echo json_encode($aResponse);
コード例 #3
0
ファイル: move.php プロジェクト: rickyrobinett/Twilio-Snake
<?php

require_once "includes/memcache.php";
// do some quick setup
$memcache = new RR_Memcache();
$callKey = $_REQUEST['callKey'];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
echo "<Response><Say>";
switch ($_REQUEST['Digits']) {
    case 2:
        echo "up";
        $memcache->set($callKey, "up");
        break;
    case 4:
        echo "left";
        $memcache->set($callKey, "left");
        break;
    case 6:
        echo "right";
        $memcache->set($callKey, "right");
        break;
    case 8:
        echo "down";
        $memcache->set($callKey, "down");
        break;
    default:
        echo "pause";
        $memcache->set($callKey, "pause");
        break;
}
echo '</Say>';
コード例 #4
0
<?php

require_once "includes/memcache.php";
$memcache = new RR_Memcache();
$callKey = $_REQUEST['callKey'];
$memcache->set($callKey, "stop");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<Response>
  <Hangup />
</Response>