function hybridauth_requirements in HybridAuth Social Login 7
Same name and namespace in other branches
- 6.2 hybridauth.install \hybridauth_requirements()
- 7.2 hybridauth.install \hybridauth_requirements()
Implementation of hook_requirements().
File
- ./
hybridauth.install, line 6
Code
function hybridauth_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time
$t = get_t();
if ($phase == 'runtime') {
$lib_path = libraries_get_path('hybridauth', FALSE);
if ($lib_path) {
try {
require_once $lib_path . '/Hybrid/Auth.php';
$requirements['hybridauth'] = array(
'title' => $t('HybridAuth'),
'value' => Hybrid_Auth::$version,
'severity' => REQUIREMENT_INFO,
);
} catch (Exception $e) {
$requirements['hybridauth'] = array(
'title' => $t('HybridAuth'),
'value' => $e
->getMessage(),
'severity' => REQUIREMENT_ERROR,
);
}
}
else {
$requirements['hybridauth'] = array(
'title' => $t('HybridAuth'),
'value' => $t('library is missing'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}