|
|
|
@ -49,6 +49,13 @@ class RoomController extends AbstractController
@@ -49,6 +49,13 @@ class RoomController extends AbstractController
|
|
|
|
|
?Request $request |
|
|
|
|
): Response |
|
|
|
|
{ |
|
|
|
|
// Connect memcached |
|
|
|
|
$memcached = new \Memcached(); |
|
|
|
|
$memcached->addServer( |
|
|
|
|
$this->getParameter('app.memcached.host'), |
|
|
|
|
$this->getParameter('app.memcached.port') |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Connect kevacoin |
|
|
|
|
$client = new \Kevachat\Kevacoin\Client( |
|
|
|
|
$this->getParameter('app.kevacoin.protocol'), |
|
|
|
@ -59,6 +66,15 @@ class RoomController extends AbstractController
@@ -59,6 +66,15 @@ class RoomController extends AbstractController
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Get room list |
|
|
|
|
$memory = md5( |
|
|
|
|
sprintf( |
|
|
|
|
'%s.RoomController::list:list', |
|
|
|
|
__DIR__, |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (!$list = $memcached->get($memory)) |
|
|
|
|
{ |
|
|
|
|
$list = []; |
|
|
|
|
|
|
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
@ -116,6 +132,13 @@ class RoomController extends AbstractController
@@ -116,6 +132,13 @@ class RoomController extends AbstractController
|
|
|
|
|
$list |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Cache result |
|
|
|
|
$memcached->set( |
|
|
|
|
$memory, |
|
|
|
|
$list |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// RSS |
|
|
|
|
if ('rss' === $request->get('feed')) |
|
|
|
|
{ |
|
|
|
|