This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
forked from cosmicdreams/drupal-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gathercontent.install
70 lines (63 loc) · 1.86 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* @file
* Install, uninstall, and update functions for the GatherContent module.
*/
/**
* Implements hook_requirements().
*/
function gathercontent_requirements($phase) {
$requirements = array();
$has_curl = function_exists('curl_init');
$t = get_t();
$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;
}
/**
* Implements hook_uninstall().
*/
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_selected_items');
variable_del('gathercontent_saved_settings');
variable_del('gathercontent_saved_pages');
variable_del('gathercontent_saved_items');
}
/**
* Implements hook_schema().
*/
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;
}