password_strength.install in Password Strength 7
Same filename and directory in other branches
Installation and requirements for Password Strength module.
File
password_strength.installView source
<?php
/**
* @file
* Installation and requirements for Password Strength module.
*/
/**
* Implementation of hook_requirements().
*/
function password_strength_requirements($phase) {
$requirements = array();
$installed = FALSE;
if (class_exists('ZxcvbnPhp\\Zxcvbn')) {
$installed = TRUE;
}
switch ($phase) {
case 'runtime':
if (!$installed) {
$requirements['password_strength'] = array(
'title' => t('Password Strength'),
'severity' => REQUIREMENT_ERROR,
'value' => t('Library not available'),
'description' => t('The Password Strength library Zxcvbn-PHP is not detected. Consult the README.md for installation instructions.'),
);
}
break;
}
return $requirements;
}
/**
* Implements hook_uninstall().
*/
function password_strength_uninstall() {
variable_del('password_strength_default_required_score');
variable_del('password_strength_default_password_length');
}
Functions
Name | Description |
---|---|
password_strength_requirements | Implementation of hook_requirements(). |
password_strength_uninstall | Implements hook_uninstall(). |