You are here

function advagg_file_get_contents in Advanced CSS/JS Aggregation 7.2

Same as file_get_contents() but will convert string to UTF-8 if needed.

Return value

mixed The files contents or FALSE on failure.

30 calls to advagg_file_get_contents()
AdvAggCascadingStylesheetsTestCase::testRenderFile in tests/advagg.test
Tests rendering the stylesheets.
advagg_advagg_get_info_on_files_alter in ./advagg.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_aggressive_cache_conflicts in ./advagg.module
Check and see if the aggressive cache can safely be enabled.
advagg_css_alter in advagg_font/advagg_font.module
Implements hook_css_alter().
advagg_detect_subfile_changes in ./advagg.cache.inc
See if any of the subfiles has changed.

... See full list

File

./advagg.module, line 6310
Advanced CSS/JS aggregation module.

Code

function advagg_file_get_contents() {

  // Get the file contents.
  $file_contents = call_user_func_array('file_get_contents', func_get_args());
  if ($file_contents === FALSE) {
    return $file_contents;
  }

  // If a BOM is found, convert the file to UTF-8.
  $encoding = advagg_get_encoding_from_bom($file_contents);
  if (!empty($encoding)) {
    $file_contents = advagg_convert_to_utf8($file_contents, $encoding);
  }
  return $file_contents;
}