1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Installation file for Feeds JSONPath Parser module.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
7707c013
|
Assos Assos
|
* Implements hook_requirements().
|
10 |
85ad3d82
|
Assos Assos
|
*/
|
11 |
|
|
function feeds_jsonpath_parser_requirements($phase) {
|
12 |
|
|
$requirements = array();
|
13 |
|
|
|
14 |
7707c013
|
Assos Assos
|
if ($phase !== 'runtime' && $phase !== 'install') {
|
15 |
|
|
return $requirements;
|
16 |
85ad3d82
|
Assos Assos
|
}
|
17 |
7707c013
|
Assos Assos
|
|
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 |
85ad3d82
|
Assos Assos
|
return $requirements;
|
39 |
|
|
} |