You are here

function cleaner_cleaner_run in Cleaner 7

Same name and namespace in other branches
  1. 8 cleaner.module \cleaner_cleaner_run()
  2. 5 cleaner.module \cleaner_cleaner_run()
  3. 6 cleaner.module \cleaner_cleaner_run()

Implements hook_cleaner_run().

This hook run all actions, which has been set via admin settings page.

File

./cleaner.module, line 202
Allows the admin to set a schedule for clearing caches and other stuff.

Code

function cleaner_cleaner_run() {

  // Watchdog.
  if (variable_get('cleaner_empty_watchdog', 0)) {
    Cleaner::cleanerWatchdogClear();
  }

  // Cache.
  if (variable_get('cleaner_clear_cache', 0)) {
    Cleaner::cleanerCacheClear();
  }

  // Additional tables.
  if (variable_get('cleaner_additional_tables', '')) {
    Cleaner::cleanerAdditionalTablesClear();
  }

  // Sessions.
  if (variable_get('cleaner_clean_sessions', 0)) {
    Cleaner::cleanerSessionsClear();
  }

  // CSS.
  if (variable_get('cleaner_clean_cssdir', 0)) {
    Cleaner::cleanerCssClear();
  }

  // JS.
  if (variable_get('cleaner_clean_jsdir', 0)) {
    Cleaner::cleanerJsClear();
  }

  // MySQL optimizing.
  if ($opt = variable_get('cleaner_optimize_db', 0)) {
    Cleaner::cleanerMysqlOptimizing($opt);
  }
}