aggregator_sanitize_configuration

Versions
mediamosa-21
aggregator_sanitize_configuration()

Check and sanitize aggregator configuration.

Goes through all fetchers, parsers and processors and checks whether they are available. If one is missing resets to standard configuration.

Return value

TRUE if this function reset the configuration FALSE if not.

Code

modules/aggregator/aggregator.module, line 742

<?php
function aggregator_sanitize_configuration() {
  $reset = FALSE;
  list($fetcher, $parser, $processors) = _aggregator_get_variables();
  if (!module_exists($fetcher)) {
    $reset = TRUE;
  }
  if (!module_exists($parser)) {
    $reset = TRUE;
  }
  foreach ($processors as $processor) {
    if (!module_exists($processor)) {
      $reset = TRUE;
      break;
    }
  }
  if ($reset) {
    variable_del('aggregator_fetcher');
    variable_del('aggregator_parser');
    variable_del('aggregator_processors');
    return TRUE;
  }
  return FALSE;
}
?>