-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwhois.install
40 lines (36 loc) · 1.42 KB
/
whois.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// $Id: whois.install,v 1.6 2010/01/19 15:02:59 helmo Exp $
/**
* @file
* Install, update and uninstall functions for the Whois module.
*/
/**
* Implementation of hook_requirements().
*/
function whois_requirements($phase) {
$requirements = array();
$t = get_t();
switch ($phase) {
case 'install':
case 'runtime':
$path = drupal_get_path('module', 'whois') . '/phpwhois/whois.main.php';
if (!file_exists($path)) {
$requirements['whois'] = array(
'title' => $t('Whois lookup'),
'description' => $t("Whois module requires !phpwhois to do whois queries. !download and put it's contents in <em>modules/whois</em> directory (so that it looks something like this: <em>modules/whois/phpwhois/example.php</em>).", array('!phpwhois' => l('phpWhois library', 'http://phpwhois.sf.net/'), '!download' => l('Download phpWhois', 'http://sourceforge.net/project/showfiles.php?group_id=31207&package_id=23260'))),
'severity' => $phase == 'install' ? REQUIREMENT_WARNING : REQUIREMENT_ERROR,
'value' => $t('!phpwhois library missing', array('!phpwhois' => l('phpWhois', 'http://phpwhois.sf.net/'))),
);
}
}
return $requirements;
}
/**
* Implementation of hook_uninstall().
*/
function whois_uninstall() {
variable_del('whois_output_method');
variable_del('whois_enable_ajax');
variable_del('whois_hourly_threshold');
variable_del('whois_log_watchdog');
}