smart_ip_maxmind_geoip2_bin_db.install in Smart IP 8.3
Same filename and directory in other branches
File
modules/smart_ip_maxmind_geoip2_bin_db/smart_ip_maxmind_geoip2_bin_db.installView source
<?php
use Drupal\Core\Link;
use Drupal\Core\Url;
/**
* Implements hook_requirements().
*/
function smart_ip_maxmind_geoip2_bin_db_requirements($phase) {
$requirements = [];
if ($phase == 'install') {
if (!class_exists('\\GeoIp2\\Database\\Reader')) {
$requirements['geoip2_library'] = [
'description' => t('Smart IP MaxMind GeoIP2 binary database module requires the
geoip2/geoip2 library. To setup, follow this @guide', [
'@guide' => Link::fromTextAndUrl(t('guide'), Url::fromUri('https://www.webfoobar.com/node/71'))
->toString(),
]),
'severity' => REQUIREMENT_ERROR,
];
}
}
return $requirements;
}
/**
* Implements hook_uninstall().
*/
function smart_ip_maxmind_geoip2_bin_db_uninstall() {
// Remove all stored states
\Drupal::state()
->deleteMultiple([
'smart_ip_maxmind_geoip2_bin_db.last_update_time',
]);
}
Functions
Name | Description |
---|---|
smart_ip_maxmind_geoip2_bin_db_requirements | Implements hook_requirements(). |
smart_ip_maxmind_geoip2_bin_db_uninstall | Implements hook_uninstall(). |