You are here

function strongarm_vars_load in Strongarm 6.2

Same name and namespace in other branches
  1. 7.2 strongarm.module \strongarm_vars_load()

Load all variables (DB and Strongarmed).

5 calls to strongarm_vars_load()
strongarm_admin_form in ./strongarm.admin.inc
Variable management strongarm form.
strongarm_update_6202 in ./strongarm.install
Update 6202: Set all strongarm variables that are only set in code in the database.
variable_features_export in ./strongarm.module
Implements hook_features_export().
variable_features_rebuild in ./strongarm.module
Implementation of hook_features_rebuild(). Same as revert, but we only want to force variables only in code into the database
_drush_strongarm_revert in ./strongarm.drush.inc
Handle the revert of variables into the database.

File

./strongarm.module, line 85

Code

function strongarm_vars_load($sorted = TRUE, $reset = FALSE) {
  ctools_include('export');
  static $vars;

  // Ensure that the schema cache is not stale when trying to load.
  $schema = drupal_get_schema('variable');
  if (!isset($schema['export']) || $reset) {
    ctools_export_load_object_reset('variable');
    drupal_get_schema('variable', TRUE);
  }

  // Load vars.
  if (!isset($vars) || $reset) {
    $vars = ctools_export_load_object('variable');
    if ($sorted) {
      ksort($vars);
    }
  }
  return $vars;
}