You are here

nodejs.install in Node.js integration 6

Same filename and directory in other branches
  1. 8 nodejs.install
  2. 7 nodejs.install

Install, update and uninstall functions for the nodejs module.

File

nodejs.install
View source
<?php

// $Id: $

/**
 * @file
 * Install, update and uninstall functions for the nodejs module.
 */

/**
 * @file
 * Install, update and uninstall functions for the nodejs module.
 */

/**
 * Implements hook_uninstall().
 */
function nodejs_uninstall() {
  variable_del('nodejs_server_scheme');
  variable_del('nodejs_server_host');
  variable_del('nodejs_server_port');
  drupal_uninstall_schema('nodejs');
}

/**
 * Implements hook_schema().
 */
function nodejs_schema() {
  return array(
    'nodejs_presence' => array(
      'description' => 'List of currently online users on a node.js server.',
      'fields' => array(
        'uid' => array(
          'description' => 'The uid of the user.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
          'default' => 0,
        ),
        'login_time' => array(
          'description' => 'The timestamp of when the user came online.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
          'default' => 0,
        ),
      ),
      'indexes' => array(
        'login_time' => array(
          'login_time',
        ),
      ),
      'unique keys' => array(
        'uid' => array(
          'uid',
        ),
      ),
    ),
  );
}

/**
 * Implements hook_install().
 */
function nodejs_install() {
  drupal_install_schema('nodejs');
}

Functions

Namesort descending Description
nodejs_install Implements hook_install().
nodejs_schema Implements hook_schema().
nodejs_uninstall Implements hook_uninstall().