Implements hook_requirements().

Fichier

advagg_mod/advagg_mod.install, line 63

Code

function advagg_mod_requirements($phase) {
    $requirements = array();
    // Ensure translations don't break at install time.
    $t = get_t();
    // If not at runtime, return here.
    if ($phase !== 'runtime') {
        return $requirements;
    }
    // Check version.
    $lib_name = 'loadCSS';
    $module_name = 'advagg_mod';
    list($description, $info) = advagg_get_version_description($lib_name, $module_name);
    if (!empty($description)) {
        $requirements["{$module_name}_{$lib_name}_updates"] = array(
            'title' => $t('@module_name', array(
                '@module_name' => $info['name'],
            )),
            'severity' => REQUIREMENT_WARNING,
            'value' => $t('The @name library needs to be updated.', array(
                '@name' => $lib_name,
            )),
            'description' => $description,
        );
    }
    return $requirements;
}