1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Installation file for Feeds JSONPath Parser module.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implements hook_requirements().
|
10
|
*/
|
11
|
function feeds_jsonpath_parser_requirements($phase) {
|
12
|
$requirements = array();
|
13
|
|
14
|
if ($phase !== 'runtime' && $phase !== 'install') {
|
15
|
return $requirements;
|
16
|
}
|
17
|
|
18
|
drupal_load('module', 'feeds_jsonpath_parser');
|
19
|
|
20
|
$t = get_t();
|
21
|
$requirements['feeds_jsonpath_parser']['title'] = $t('JSONPath library');
|
22
|
$requirements['feeds_jsonpath_parser']['severity'] = REQUIREMENT_OK;
|
23
|
$requirements['feeds_jsonpath_parser']['value'] = $t('Installed');
|
24
|
|
25
|
if (!feeds_jsonpath_parser_library_path()) {
|
26
|
$requirements['feeds_jsonpath_parser']['severity'] = REQUIREMENT_ERROR;
|
27
|
$requirements['feeds_jsonpath_parser']['description'] = $t('The <a href="@jsonpath">JSONPath</a> plugin is missing. Download <a href="@download">this file</a> and place in sites/all/libraries/jsonpath.', array(
|
28
|
'@jsonpath' => 'http://goessner.net/articles/JsonPath/',
|
29
|
'@download' => 'http://jsonpath.googlecode.com/svn/trunk/src/php/jsonpath.php',
|
30
|
));
|
31
|
$requirements['feeds_jsonpath_parser']['value'] = $t('Not installed');
|
32
|
}
|
33
|
|
34
|
if ($phase === 'install') {
|
35
|
unset($requirements['feeds_jsonpath_parser']['value']);
|
36
|
}
|
37
|
|
38
|
return $requirements;
|
39
|
}
|