forked from dingproject/ting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathting.install
83 lines (71 loc) · 1.71 KB
/
ting.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
<?php
/**
* @file
* Install file providing upgrade hooks for ting.
*/
/**
* Migrate from alma_periodical to ting_periodical.
*/
function ting_update_6001() {
$ret = array();
if (module_exists('alma_periodical')) {
drupal_install_modules(array('ting_periodical'));
$ret[] = array(
'success' => TRUE,
'query' => t('Replaced alma_periodical with ting_periodical.'),
);
drupal_uninstall_module('alma_periodical');
}
return $ret;
}
/**
* Migrate to ting_proxy.
*/
function ting_update_6002() {
// Install ting proxy
drupal_install_modules(array('ting_proxy'));
// Get prefix
$proxy = array();
$proxy['prefix'] = variable_get('restricted_access_proxy_prefix', '');
$key = 0;
$hostnames = variable_get('restricted_access_proxy_hostnames', array());
foreach ($hostnames as $hostname) {
$proxy['hostnames'][$key] = array(
'url' => $hostname,
'regex' => '',
'replacement' => '',
'no' => 0,
);
$key++;
}
// Save settings
variable_set('ting_proxy', $proxy);
// Clean up
variable_del('restricted_access_proxy_prefix');
variable_del('restricted_access_proxy_hostnames');
// Return message
$ret[] = array(
'success' => TRUE,
'query' => t('Update to ting proxy completed.'),
);
return $ret;
}
/**
* Correct WSDL typo.
*
* Variable was named wdsl in place of wsdl.
*/
function ting_update_6003() {
$url = variable_get('addi_wdsl_url', '');
if (!empty($url)) {
variable_set('addi_wsdl_url', $url);
}
variable_del('addi_wdsl_url', $url);
}
/**
* Installed the new dependency, NanoSOAP.
*/
function ting_update_6004() {
// Install NanoSOAP and dependencies.
drupal_install_modules(array('autoload', 'nanosoap'));
}