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 dans tests/advagg.test
Tests rendering the stylesheets.
advagg_advagg_get_info_on_files_alter dans ./advagg.advagg.inc
Implements hook_advagg_get_info_on_files_alter().
advagg_aggressive_cache_conflicts dans ./advagg.module
Check and see if the aggressive cache can safely be enabled.
advagg_css_alter dans advagg_font/advagg_font.module
Implements hook_css_alter().
advagg_detect_subfile_changes dans ./advagg.cache.inc
See if any of the subfiles has changed.

... See full list

Fichier

./advagg.module, line 6312

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;
}