/[drupal]/contributions/modules/apachesolr/apachesolr_search.install
ViewVC logotype

Contents of /contributions/modules/apachesolr/apachesolr_search.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Mon Jun 29 23:23:08 2009 UTC (4 months, 4 weeks ago) by pwolanin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +0 -0 lines
File MIME type: text/x-php
sync with DRUPAL-6--1
1 <?php
2 // $Id: apachesolr_search.install,v 1.1.2.5 2009/04/14 00:12:18 pwolanin Exp $
3
4 /**
5 * @file
6 * Install and related hooks for apachesolr_search.
7 */
8
9 /**
10 * Implementation of hook_uninstall().
11 * Update to namespace tracking.
12 */
13 function apachesolr_search_uninstall() {
14 apachesolr_clear_last_index('apachesolr_search');
15 }
16
17 /**
18 * Update to namespace tracking.
19 */
20 function apachesolr_search_update_6000() {
21 $change = variable_get('apachesolr_search_last_change', 0);
22 $nid = variable_get('apachesolr_search_last_nid', 0);
23 if ($change || $nid) {
24 $stored = variable_get('apachesolr_index_last', array());
25 $stored['apachesolr_search'] = array('last_change' => $change, 'last_nid' => $nid);
26 variable_set('apachesolr_index_last', $stored);
27 }
28 variable_del('apachesolr_search_last_change');
29 variable_del('apachesolr_search_last_nid');
30 return array();
31 }
32
33 /**
34 * Update to block deltas.
35 */
36 function apachesolr_search_update_6001() {
37 $ret = array();
38 if ($fields = apachesolr_cck_fields()) {
39 foreach ($fields as $name => $field) {
40 $index_key = substr(apachesolr_index_key($field), 0, 32);
41 $new_delta = $field['field_name'];
42 $ret[] = update_sql("UPDATE {blocks} SET delta = '". $new_delta ."' WHERE module = 'apachesolr_search' AND delta = '". $index_key ."'");
43 $ret[] = update_sql("UPDATE {blocks_roles} SET delta = '". $new_delta ."' WHERE module = 'apachesolr_search' AND delta = '". $index_key ."'");
44 }
45 }
46 return $ret;
47 }
48
49 /**
50 * Update mis-named variables.
51 */
52 function apachesolr_search_update_6002() {
53 $ret = array();
54 $date_settings = variable_get('apacehsolr_search_date_boost', '');
55 $comment_settings = variable_get('apacehsolr_search_comment_boost', '');
56 if ($date_settings) {
57 variable_set('apachesolr_search_date_boost', $date_settings);
58 }
59 if ($comment_settings) {
60 variable_set('apachesolr_search_comment_boost', $comment_settings);
61 }
62 variable_del('apacehsolr_search_date_boost');
63 variable_del('apacehsolr_search_comment_boost');
64 return $ret;
65 }
66
67 /**
68 * Enable facet missing for books.
69 */
70 function apachesolr_search_update_6003() {
71 $ret = array();
72 $facet_missing = variable_get('apachesolr_facet_missing', array());
73 $facet_missing['apachesolr_search']['is_book_bid'] = 1;
74 variable_set('apachesolr_facet_missing', $facet_missing);
75 return $ret;
76 }

  ViewVC Help
Powered by ViewVC 1.1.2