forked from Islandora/islandora_solr_search
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathislandora_solr_search.install
89 lines (78 loc) · 3.05 KB
/
islandora_solr_search.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
/*
* @file
* islandora_solr_search install file
*/
/**
* Implementation of hook_requirements().
*
* @return
* An array describing the status of the site regarding available updates.
* If there is no update data, only one record will be returned, indicating
* that the status of core can't be determined. If data is available, there
* will be two records: one for core, and another for all of contrib
* (assuming there are any contributed modules or themes enabled on the
* site). In addition to the fields expected by hook_requirements ('value',
* 'severity', and optionally 'description'), this array will contain a
* 'reason' attribute, which is an integer constant to indicate why the
* given status is being returned (UPDATE_NOT_SECURE, UPDATE_NOT_CURRENT, or
* UPDATE_UNKNOWN). This is used for generating the appropriate e-mail
* notification messages during update_cron(), and might be useful for other
* modules that invoke update_requirements() to find out if the site is up
* to date or not.
*
* @see _update_message_text()
* @see _update_cron_notify()
*/
function islandora_solr_search_requirements($phase) {
$t = get_t();
$requirements = array();
module_load_include('php', 'islandora_solr_search', 'SolrPhpClient/Apache/Solr/Service');
if ($phase == 'install') {
if (!class_exists('Apache_Solr_Service')) {
$requirements['islandora_solr_search'] = array(
'title' => $t('Missing Apache Client'),
'description' => $t('This module requires the ' . l('Apache Solr php client', 'http://code.google.com/p/solr-php-client') . '. Please install the client directory in the root directory of this module before continuing.'),
'severity' => REQUIREMENT_ERROR,
);
}
}
return $requirements;
}
/**
* Implementation of hook_install().
*/
function islandora_solr_search_install() {
$message = st("Islandora Solr Search <a href ='!link'>configuration page</a>.", array('!link' => '/admin/settings/islandora_solr_search'));
drupal_set_message(check_plain($message));
}
/**
* Implementation of hook_uninstall().
*/
function islandora_solr_search_uninstall() {
// removing variables
// @TODO: update the latest additions
$variables = array(
'islandora_solr_primary_display',
'islandora_solr_primary_display_table',
'islandora_solr_secondary_display',
'islandora_solr_searchterms',
'islandora_solr_search_block_facets',
'islandora_solr_search_block_facet_limit',
'islandora_solr_search_block_facet_min_count',
'islandora_solr_search_block_facet_shown_limit',
'islandora_solr_search_block_repeat',
'islandora_solr_search_block_request_handler',
'islandora_solr_search_block_url',
'islandora_solr_search_debug_mode',
'islandora_solr_search_limit_result_fields',
'islandora_solr_search_num_of_results',
'islandora_solr_search_result_fields',
'islandora_solr_search_sort_field',
'islandora_solr_search_sort_order',
'islandora_solr_snippet_field',
);
foreach ($variables as $variable) {
variable_del($variable);
}
}