Skip to content

PHP example (tinyredisclient)

Josh Baker edited this page Jun 8, 2018 · 1 revision

tinyredisclient project page

Example

All Tile38 commands should be sent using the redis->__call(command, args) function.

$redis = new \TinyRedisClient("127.0.0.1:9851");

$redis->__call("output", ["json"]);

$redis->__call("set", ["fleet", "truck1", "point", 33.5123, -112.2693]);
$redis->__call("set", ["fleet", "truck2", "point", 33.4626, -112.1695]);
$redis->__call("scan", ["fleet"]);
$redis->__call("nearby", ["fleet", "point", 33.462, -112.268, 6000]);
$redis->__call("get", ["fleet", "truck1"]);
$redis->__call("del", ["fleet", "truck2"]);
$redis->__call("drop", ["fleet"]);

Thanks to @iguk for providing this example code

Clone this wiki locally