You are here

feeds_fast_news.install in Feeds 7

Same filename and directory in other branches
  1. 6 feeds_fast_news/feeds_fast_news.install

Install hooks.

File

feeds_fast_news/feeds_fast_news.install
View source
<?php

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

/**
 * Implementation of hook_schema().
 */
function feeds_fast_news_schema() {

  // Install data tables.
  include_once 'feeds_fast_news.data_default.inc';
  $tables = feeds_fast_news_data_default();
  $schema = array();
  foreach ($tables as $name => $table) {
    $schema[$name] = $table->table_schema;
  }
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function feeds_fast_news_install() {

  // We are replacing feeds_defaults module, taking over its table.
  // Hence we cannot use drupal_install_schema('feeds_fast_news');
  $schema = drupal_get_schema_unprocessed('feeds_fast_news');
  _drupal_initialize_schema('feeds_fast_news', $schema);
  $ret = array();
  foreach ($schema as $name => $table) {

    // Check whether table exists.
    if (!db_table_exists($name)) {
      db_create_table($ret, $name, $table);
    }
  }
}

/**
 * Implementation of hook_uninstall();
 */
function feeds_defaults_uninstall() {
  drupal_uninstall_schema('feeds_fast_news');
}

Functions

Namesort descending Description
feeds_defaults_uninstall Implementation of hook_uninstall();
feeds_fast_news_install Implementation of hook_install().
feeds_fast_news_schema Implementation of hook_schema().