You are here

function nodejs_get_channels in Node.js integration 6

Get a list of active channels from the node.js server.

@access public

Return value

array

File

./nodejs.module, line 283

Code

function nodejs_get_channels() {
  $response = Nodejs::getChannels();
  if (isset($response->error)) {
    watchdog('nodejs', t('Error getting channel list from Node.js server: [%code] %error', array(
      '%code' => $response->code,
      '%error' => $response->error,
    )));
    return array();
  }
  else {
    $channels = json_decode($response->data);
    return (array) $channels;
  }
}