You are here

function hook_advagg_get_info_on_files_alter in Advanced CSS/JS Aggregation 7.2

Let other modules add/alter additional information about files passed in.

Parameters

array $return: An associative array; filename -> data.

array $cached_data: What data was found in the cache; cache_id -> data.

bool $bypass_cache: If TRUE the loaded data did not come from the cache.

See also

advagg_get_info_on_files()

advagg_advagg_get_info_on_files_alter()

Related topics

5 functions implement hook_advagg_get_info_on_files_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

advagg_advagg_get_info_on_files_alter in ./advagg.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_font_advagg_get_info_on_files_alter in advagg_font/advagg_font.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_js_compress_advagg_get_info_on_files_alter in advagg_js_compress/advagg_js_compress.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_mod_advagg_get_info_on_files_alter in advagg_mod/advagg_mod.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_relocate_advagg_get_info_on_files_alter in advagg_relocate/advagg_relocate.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
1 invocation of hook_advagg_get_info_on_files_alter()
advagg_get_info_on_files in ./advagg.inc
Given a filename calculate various hashes and gather meta data.

File

./advagg.api.php, line 628
Hooks provided by the AdvAgg module.

Code

function hook_advagg_get_info_on_files_alter(array &$return, array $cached_data, $bypass_cache) {
  if (!variable_get('advagg_ie_css_selector_limiter', ADVAGG_IE_CSS_SELECTOR_LIMITER)) {
    return;
  }
  $limit_value = variable_get('advagg_ie_css_selector_limiter_value', ADVAGG_IE_CSS_SELECTOR_LIMITER_VALUE);
  list($css_path, $js_path) = advagg_get_root_files_dir();
  if ($js_path) {

    // This is the js_path array.
  }
  $parts_path = $css_path[1] . '/parts';
  foreach ($return as $filename => &$info) {
    if ($filename) {

      // This is the filename.
    }
    if (empty($info['fileext']) || $info['fileext'] !== 'css') {
      continue;
    }

    // Break large file into multiple small files.
    if ($info['linecount'] > $limit_value) {
      advagg_split_css_file($info);
    }
    elseif (strpos($info['data'], $parts_path) === 0) {
      $info['split'] = TRUE;
    }
  }
  unset($info);
}