You are here

strongarm.install in Strongarm 7.2

Same filename and directory in other branches
  1. 6.2 strongarm.install
  2. 6 strongarm.install

Install, update and uninstall functions for the strongarm module.

File

strongarm.install
View source
<?php

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

/**
 * Implements hook_enable().
 */
function strongarm_enable() {

  // Weight strongarm exceptionally light.
  db_update('system')
    ->fields(array(
    'weight' => -1000,
  ))
    ->condition('name', 'strongarm')
    ->condition('type', 'module')
    ->execute();
}

/**
 * Transition Strongarm variables from code to the database.
 */
function strongarm_update_7201() {
  module_load_include('module', 'strongarm');
  $variables = strongarm_vars_load(TRUE, TRUE);
  if (!empty($variables)) {
    foreach ($variables as $var_name => $var) {
      $exists = db_query("SELECT name FROM {variable} WHERE name = :name", array(
        ':name' => $var_name,
      ))
        ->fetchField();
      if (!$exists) {
        variable_set($var_name, $var->value);
      }
    }
  }
}

Functions

Namesort descending Description
strongarm_enable Implements hook_enable().
strongarm_update_7201 Transition Strongarm variables from code to the database.