You are here

function nodejs_get_socketio_js_config in Node.js integration 7

Same name and namespace in other branches
  1. 8 nodejs.module \nodejs_get_socketio_js_config()
  2. 6 nodejs.module \nodejs_get_socketio_js_config()

Return the path to the socket.io client js.

1 call to nodejs_get_socketio_js_config()
nodejs_init in ./nodejs.module
Implements hook_init().

File

./nodejs.module, line 298

Code

function nodejs_get_socketio_js_config($nodejs_config) {
  $socket_io_config = array(
    'path' => variable_get('nodejs_socket_io_path', FALSE),
    'type' => variable_get('nodejs_socket_io_type', 'internal'),
  );
  if ($socket_io_config['type'] === 'internal' || empty($socket_io_config['path'])) {
    $socket_io_config['path'] = $nodejs_config['client']['scheme'] . '://' . $nodejs_config['client']['host'] . ':' . $nodejs_config['client']['port'] . $nodejs_config['resource'] . '/socket.io.js';
  }
  return $socket_io_config;
}