You are here

wordstream.install in WordStream Keyword Tools 6

Same filename and directory in other branches
  1. 7 wordstream.install

Install file.

File

wordstream.install
View source
<?php

/**
 * @file
 * Install file.
 */

/**
 *  Implementation of hook_install().
 */
function wordstream_install() {
  drupal_install_schema('wordstream');
  drupal_set_message(t('WordStream has been installed.'));

  // if (!variable_get('scribeseo_apikey', '')) {
  //   drupal_set_message(t('Your Scribe API Key is Empty. Please ') . l(t('configure the Scribe Content Optimizer plugin.'), 'admin/settings/scribeseo'), 'error');

  //}
}

/**
 * Implementation of hook_uninstall().
 */
function wordstream_uninstall() {
  drupal_uninstall_schema('wordstream');
  drupal_set_message(t('WordStream has been uninstalled.'));
}

/**
 *  Implementation of hook_schema
 */
function wordstream_schema() {
  $schema['wordstream_cache'] = array(
    'description' => 'Creates database table to store wordstream data.',
    'fields' => array(
      'keyphrase' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'target keyphrase.',
      ),
      //keyphrase
      'adult_filter' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
        'description' => 'timestamp of last data update',
      ),
      //adult_filter
      'api_call' => array(
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
        'default' => '',
        'description' => 'API call',
      ),
      //function
      'updated' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'description' => 'timestamp of last data update',
      ),
      //stats_update
      'data' => array(
        'type' => 'text',
        'description' => t('result from api call'),
      ),
    ),
    'primary key' => array(
      'keyphrase',
      'adult_filter',
      'api_call',
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
wordstream_install Implementation of hook_install().
wordstream_schema Implementation of hook_schema
wordstream_uninstall Implementation of hook_uninstall().