|
|
@ -52,9 +52,25 @@ class RoomController extends AbstractController |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
$this->getParameter('app.kevacoin.password') |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Connect memcached |
|
|
|
|
|
|
|
$memcached = new \Memcached(); |
|
|
|
|
|
|
|
$memcached->addServer( |
|
|
|
|
|
|
|
$this->getParameter('app.memcached.host'), |
|
|
|
|
|
|
|
$this->getParameter('app.memcached.port') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$memory = md5( |
|
|
|
|
|
|
|
sprintf( |
|
|
|
|
|
|
|
'%s.RoomController::list:rooms', |
|
|
|
|
|
|
|
__DIR__ |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Get room list |
|
|
|
// Get room list |
|
|
|
$list = []; |
|
|
|
$list = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!$list = $memcached->get($memory)) |
|
|
|
|
|
|
|
{ |
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
foreach ((array) $client->kevaListNamespaces() as $value) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Calculate room totals |
|
|
|
// Calculate room totals |
|
|
@ -101,6 +117,14 @@ class RoomController extends AbstractController |
|
|
|
$list |
|
|
|
$list |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Cache rooms to memcached as kevaListNamespaces hides rooms with pending posts |
|
|
|
|
|
|
|
$memcached->set( |
|
|
|
|
|
|
|
$memory, |
|
|
|
|
|
|
|
$list, |
|
|
|
|
|
|
|
(int) $this->getParameter('app.memcached.timeout') |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// RSS |
|
|
|
// RSS |
|
|
|
if ('rss' === $request->get('feed')) |
|
|
|
if ('rss' === $request->get('feed')) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -703,6 +727,16 @@ class RoomController extends AbstractController |
|
|
|
(int) $this->getParameter('app.add.room.remote.ip.delay') // auto remove on cache expire |
|
|
|
(int) $this->getParameter('app.add.room.remote.ip.delay') // auto remove on cache expire |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Reset rooms list cache |
|
|
|
|
|
|
|
$memcached->delete( |
|
|
|
|
|
|
|
md5( |
|
|
|
|
|
|
|
sprintf( |
|
|
|
|
|
|
|
'%s.RoomController::list:rooms', |
|
|
|
|
|
|
|
__DIR__ |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// Redirect to new room |
|
|
|
// Redirect to new room |
|
|
|
return $this->redirectToRoute( |
|
|
|
return $this->redirectToRoute( |
|
|
|
'room_namespace', |
|
|
|
'room_namespace', |
|
|
|