You are here

function scald_init in Scald: Media Management made easy 6

Implementation of hook_init().

Ensures that Scald Configuration Object is populated and cached in the db. Because the scald_config variable is always being fetched and conditionally rebuilt during hook_init, subsequent fetches of the variable can safely omit a check for validity.

NOTE: There are other important configuration variables that get forcibly rebuilt in scald_config_rebuild(), but only $scald_config is used to determine the need for the rebuild because Scald just won't run at all without it.

File

./scald.module, line 2613

Code

function scald_init() {
  $scald_config = variable_get('scald_config', 0);
  if (empty($scald_config)) {
    scald_config_rebuild();
  }
}