This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraven.install
73 lines (66 loc) · 2.2 KB
/
raven.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
<?php
/**
* @file
* Install, update, and uninstall functions for the raven module.
*/
/**
* Implements hook_install().
*/
function raven_uninstall() {
variable_del('raven_enabled');
variable_del('raven_dsn');
variable_del('raven_timeout');
variable_del('raven_exception_handler');
variable_del('raven_fatal_error_handler');
variable_del('raven_error_handler');
variable_del('raven_error_levels');
variable_del('raven_stack');
variable_del('raven_trace');
}
/**
* Implements hook_requirements().
*/
function raven_requirements($phase) {
$t = get_t();
$requirements = array();
switch ($phase) {
case 'runtime':
$raven = libraries_load('raven');
if ($raven && $raven['loaded']) {
$requirements['raven_version'] = array(
'title' => $t('Raven-php client'),
'value' => $raven['version'],
'description' => $t('To check for newer versions of raven-php, go to <a href="!url" target="_blank">!url</a>', array("!url" => url('https://github.com/getsentry/raven-php'))),
'severity' => REQUIREMENT_OK,
);
if (!variable_get('raven_enabled', FALSE)) {
$requirements['raven_enabled'] = array(
'title' => $t('Raven-php logging'),
'value' => $t('Disabled'),
'description' => $t('Raven-php logging is disabled.'),
'severity' => REQUIREMENT_WARNING,
);
}
else {
$requirements['raven_dsn'] = array(
'title' => $t('Raven-php logging'),
'value' => $t('Enabled'),
'description' => $t('Raven-php is set to log to !dsn.', array('!dsn' => variable_get('raven_dsn'))),
'severity' => REQUIREMENT_OK,
);
}
}
else {
$requirements['raven_library'] = array(
'title' => $t('Raven-php client'),
'value' => $t('Not installed'),
'description' => $t('The raven-php library was not detected. Please install the <a href="!url" target="_blank">raven-php library</a>.', array("!url" => url('https://github.com/getsentry/raven-php'))),
'severity' => REQUIREMENT_ERROR,
);
}
break;
default:
break;
}
return $requirements;
}