tamerlib/tests/redis_server.php

18 lines
No EOL
411 B
PHP

<?php
require 'ncc';
import('net.nosial.tamerlib');
$redis_server = new \TamerLib\Classes\RedisServer();
$redis_server->start();
$redis_client = new \Redis();
$redis_client->connect('127.0.0.1', $redis_server->getPort());
$redis_client->set('foo', 'bar');
$value = $redis_client->get('foo');
echo $value . PHP_EOL;
$redis_client->close();
$redis_server->stop();