You are here

function feeds_library_exists in Feeds 8.2

Same name and namespace in other branches
  1. 6 feeds.module \feeds_library_exists()
  2. 7.2 feeds.module \feeds_library_exists()
  3. 7 feeds.module \feeds_library_exists()

Checks whether a library is present.

Parameters

$file: The filename to load from.

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

Related topics

1 call to feeds_library_exists()
feeds_simplepie_exists in ./feeds.module
Checks whether simplepie exists.

File

./feeds.module, line 976
Feeds - basic API functions and hook implementations.

Code

function feeds_library_exists($file, $library) {
  if (module_exists('libraries') && file_exists(libraries_get_path($library) . "/{$file}")) {
    return TRUE;
  }
  elseif (file_exists(DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/{$file}")) {
    return TRUE;
  }
  elseif ($library_dir = variable_get('feeds_library_dir', FALSE)) {
    if (file_exists("{$library_dir}/{$library}/{$file}")) {
      return TRUE;
    }
  }
  return FALSE;
}