<?php

/**
 * @file
 * Handles AdvAgg Bundler installation and upgrade tasks.
 */

/**
 * Implementation of hook_enable().
 */
function advagg_bundler_enable() {
  // Flush advagg caches.
  $cache_tables = advagg_flush_caches();
  foreach ($cache_tables as $table) {
    cache_clear_all('*', $table, TRUE);
  }
}

/**
 * Implementation of hook_disable().
 */
function advagg_bundler_disable() {
  // Flush advagg caches.
  $cache_tables = advagg_flush_caches();
  foreach ($cache_tables as $table) {
    cache_clear_all('*', $table, TRUE);
  }
}

/**
 * Implementation of hook_uninstall().
 */
function advagg_bundler_uninstall() {
  // Remove variables.
  variable_del('advagg_bundler_outdated');
  variable_del('advagg_bundler_max_css');
  variable_del('advagg_bundler_max_js');
  variable_del('advagg_bundler_active');
}

/**
 * Implementation of hook_requirements().
 */
function advagg_bundler_requirements($phase) {
  $requirements = array();
  // Ensure translations don't break at install time
  $t = get_t();

  if ($phase == 'runtime') {
  }
  return $requirements;
}
