Révision 7707c013
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/feeds_jsonpath_parser/feeds_jsonpath_parser.install | ||
---|---|---|
1 | 1 |
<?php |
2 |
// $Id: feeds_jsonpath_parser.install,v 1.1.2.1 2010/09/28 20:18:46 twistor Exp $ |
|
3 | 2 |
|
4 | 3 |
/** |
5 | 4 |
* @file |
... | ... | |
7 | 6 |
*/ |
8 | 7 |
|
9 | 8 |
/** |
10 |
* Implementation of hook_requirements().
|
|
9 |
* Implements hook_requirements().
|
|
11 | 10 |
*/ |
12 | 11 |
function feeds_jsonpath_parser_requirements($phase) { |
13 | 12 |
$requirements = array(); |
14 | 13 |
|
15 |
if ($phase == 'install') { |
|
16 |
$t = get_t(); |
|
17 |
$requirements['feeds_jsonpath_parser']['title'] = $t('Feeds JSONPath Parser'); |
|
18 |
|
|
19 |
if (file_exists(dirname(__FILE__) . '/jsonpath-0.8.1.php')) { |
|
20 |
$requirements['feeds_jsonpath_parser']['severity'] = REQUIREMENT_OK; |
|
21 |
$requirements['feeds_jsonpath_parser']['value'] = '0.8.1'; |
|
22 |
} |
|
23 |
else { |
|
24 |
$requirements['feeds_jsonpath_parser']['severity'] = REQUIREMENT_ERROR; |
|
25 |
$requirements['feeds_jsonpath_parser']['value'] = $t('Not found'); |
|
26 |
$requirements['feeds_jsonpath_parser']['description'] = $t('The <a href="@jsonpath">JSONPath</a> plugin is missing. <a href="@download">Download</a> and place in your module directory.', array( |
|
27 |
'@jsonpath' => 'http://goessner.net/articles/JsonPath/', |
|
28 |
'@download' => 'http://jsonpath.googlecode.com/files/jsonpath-0.8.1.php', |
|
29 |
)); |
|
30 |
} |
|
14 |
if ($phase !== 'runtime' && $phase !== 'install') { |
|
15 |
return $requirements; |
|
31 | 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 |
|
|
32 | 38 |
return $requirements; |
33 | 39 |
} |
Formats disponibles : Unified diff
Update Feeds JSONPath Parser 7.x-1.0-beta2 -> 7.x-1.0