You are here

function feeds_ex_library_path in Feeds extensible parsers 7

Same name and namespace in other branches
  1. 7.2 feeds_ex.module \feeds_ex_library_path()

Returns the path of a library.

Parameters

string $library: The name of the library. If libraries module is installed, look for libraries with this name managed by libraries module.

string $file: The filename to search for.

Return value

string|bool Returns the relative path of the library, or false if it does not exist.

2 calls to feeds_ex_library_path()
FeedsExJsonUtility::jmesPathParserInstalled in src/Json/Utility.php
Determines if a JMESPath parser is installed.
feeds_ex_registry_files_alter in ./feeds_ex.module
Implements hook_registry_files_alter().

File

./feeds_ex.module, line 116
A Feeds framework used to create extensible parsers.

Code

function feeds_ex_library_path($library, $file) {
  $libraries_path = module_exists('libraries') ? libraries_get_path($library) : FALSE;
  if ($libraries_path && is_file($libraries_path . '/' . $file)) {
    return $libraries_path . '/' . $file;
  }
  elseif (is_file(DRUPAL_ROOT . '/sites/all/libraries/' . $library . '/' . $file)) {
    return 'sites/all/libraries/' . $library . '/' . $file;
  }
  return FALSE;
}