You are here

function nodejs_get_config in Node.js integration 7

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

Get nodejs server config.

Return value

array

3 calls to nodejs_get_config()
Nodejs::initConfig in ./nodejs.module
nodejs_auth_check in ./nodejs.module
Checks the given key to see if it matches a valid session.
nodejs_init in ./nodejs.module
Implements hook_init().

File

./nodejs.module, line 680

Code

function nodejs_get_config() {
  global $user;
  $defaults = array(
    'nodejs' => array(
      'scheme' => variable_get('nodejs_server_scheme', 'http'),
      'secure' => variable_get('nodejs_server_scheme', 'http') == 'https' ? 1 : 0,
      'host' => variable_get('nodejs_server_host', 'localhost'),
      'port' => variable_get('nodejs_server_port', '8080'),
    ),
    'client' => array(
      'scheme' => variable_get('nodejs_client_js_scheme', variable_get('nodejs_server_scheme', 'http')),
      'secure' => variable_get('nodejs_client_js_scheme', variable_get('nodejs_server_scheme', 'http')) == 'https' ? 1 : 0,
      'host' => variable_get('nodejs_client_js_host', variable_get('nodejs_server_host', 'localhost')),
      'port' => variable_get('nodejs_client_js_port', variable_get('nodejs_server_port', '8080')),
    ),
    'resource' => variable_get('nodejs_config_resource', '/socket.io'),
    'authToken' => nodejs_auth_get_token($user),
    'serviceKey' => variable_get('nodejs_service_key', ''),
    'websocketSwfLocation' => base_path() . drupal_get_path('module', 'nodejs') . '/socket_io/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMain.swf',
    'log_http_errors' => variable_get('nodejs_log_http_errors', TRUE),
  );
  return variable_get('nodejs_config', array()) + $defaults;
}