/** * Get a session or all the sessions information * Warning! This can return a huge amount of data * * @param Application $app The silex app. * @param Application $app The silex app. * * @return string */ public function getSession(Application $app, $id = '') { $socket = new Socket(); return $app->json($socket->getSession($id)); }
/** * Send server enable and disable messages. * * @param Application $app The silex app. * @param $action disable or enable * @param $backend backend * @param $server server * * @return string */ public function serverControl(Application $app, $action, $backend, $server) { $socket = new Socket(); $result = $socket->rawMessage($action . " server " . $backend . "/" . $server); return $app->json($result); }