You are here

features_override.install in Features Override 6

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

File

features_override.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function features_override_install() {
  drupal_install_schema('features_override');
  features_override_set_module_weight();
}

/**
 * Implementation of hook_uninstall().
 */
function features_override_uninstall() {
  drupal_uninstall_schema('features_override');
}

/**
 * Implementation of hook_schema()
 */
function features_override_schema() {
  $schema = array();
  $schema['features_override'] = array(
    'description' => 'Storage for user-defined features_override templates.',
    'export' => array(
      'key' => 'name',
      'identifier' => 'features_override',
      'default hook' => 'default_features_overrides',
      // Function hook name.
      'primary key' => 'name',
      'api' => array(
        'owner' => 'features_override',
        'api' => 'features_override',
        // Base name for api include files.
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'name' => array(
        'description' => 'The primary identifier for a features override.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'Description for this features override.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'component_type' => array(
        'description' => t('The override component type.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'component_id' => array(
        'description' => t('The override component id.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'value' => array(
        'description' => t('Serialized storage of override.'),
        'type' => 'text',
        'serialize' => TRUE,
      ),
    ),
    'indexes' => array(
      'component' => array(
        'component_type',
        'component_id',
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  return $schema;
}

/**
 * Helper function to set module weight lower than strongarm.
 *
 * This allows features_override_strongarm_alter() to be declared before
 * strongarm_init() is called, so we can alter variables at runtime.
 *
 * @see http://drupal.org/node/1271306
 */
function features_override_set_module_weight() {
  $ret = array();
  $ret[] = update_sql("update {system} set weight = -1001 where name = 'features_override'");
  return $ret;
}

/**
 * Update 6100: Set module weight lower than strongarm.
 */
function features_override_update_6100() {
  return features_override_set_module_weight();
}

Functions

Namesort descending Description
features_override_install Implementation of hook_install().
features_override_schema Implementation of hook_schema()
features_override_set_module_weight Helper function to set module weight lower than strongarm.
features_override_uninstall Implementation of hook_uninstall().
features_override_update_6100 Update 6100: Set module weight lower than strongarm.