function feeds_ex_jsonpath_library_path in Feeds extensible parsers 7.2
Returns the path of the JSONPath library.
We can't use feeds_ex_library_path() becuase we look in multiple locations. It's truly a kindness.
Return value
string|bool The relative path of the JSONPath directory, or false if not found.
2 calls to feeds_ex_jsonpath_library_path()
- FeedsExJsonPath::loadLibrary in src/
FeedsExJsonPath.inc - Loads the necessary library.
- feeds_ex_feeds_plugins in ./
feeds_ex.feeds.inc - Implements hook_feeds_plugins().
File
- ./
feeds_ex.module, line 100 - A Feeds framework used to create extensible parsers.
Code
function feeds_ex_jsonpath_library_path() {
if (module_exists('libraries') && file_exists(libraries_get_path('jsonpath'))) {
$path = libraries_get_path('jsonpath');
}
elseif (file_exists(DRUPAL_ROOT . '/sites/all/libraries/jsonpath')) {
$path = 'sites/all/libraries/jsonpath';
}
elseif (defined('FEEDS_EX_LIBRARY_PATH')) {
$path = FEEDS_EX_LIBRARY_PATH . '/jsonpath';
}
if (!isset($path)) {
return FALSE;
}
// Newer forks of JSONPath are all modern and fancy with their autoloaders.
if (file_exists($path . '/vendor/autoload.php')) {
return $path . '/vendor/autoload.php';
}
// Old school. Look for multiple versions.
foreach (glob($path . '/jsonpath*.php') as $file) {
return $file;
}
return FALSE;
}