-
Notifications
You must be signed in to change notification settings - Fork 0
/
gathercontent.install
53 lines (47 loc) · 1.54 KB
/
gathercontent.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
<?php
function gathercontent_requirements($phase) {
$requirements = array();
$has_curl = function_exists('curl_init');
$requirements['curl'] = array(
'title' => t('cURL'),
'value' => ($has_curl ? t('Enabled') : t('Not found')),
);
if(!$has_curl) {
$requirements['curl']['severity'] = REQUIREMENT_ERROR;
$requirements['curl']['description'] = t('GatherContent could not be installed because the PHP <a href="@curl_url">cURL</a> library is not available.', array('@curl_url' => 'http://php.net/manual/en/curl.setup.php'));
}
return $requirements;
}
function gathercontent_uninstall() {
variable_del('gathercontent_project_id');
variable_del('gathercontent_api_url');
variable_del('gathercontent_api_key');
variable_del('gathercontent_media_files');
variable_del('gathercontent_selected_pages');
variable_del('gathercontent_saved_settings');
variable_del('gathercontent_saved_pages');
}
function gathercontent_schema() {
$schema['gathercontent_media'] = array(
'description' => 'Contains media file IDs to prevent multiple downloads',
'fields' => array(
'fid' => array(
'description' => 'Drupal file fid from the file_managed table',
'type' => 'int',
'unsigned' => true,
'not null' => true,
),
'gid' => array(
'description' => 'GatherContent file ID',
'type' => 'int',
'unsigned' => true,
'not null' => true,
)
),
'unique keys' => array(
'fid' => array('fid'),
'gid' => array('gid'),
),
);
return $schema;
}