You are here

function feeds_include_library in Feeds 7

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

Includes a library file.

Parameters

$file: The filename to load from.

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

Related topics

11 calls to feeds_include_library()
CommonSyndicationParserTestCase::setUp in tests/common_syndication_parser.test
Set up.
FeedsCSVParser::parse in plugins/FeedsCSVParser.inc
Implements FeedsParser::parse().
FeedsEnclosure::getContent in plugins/FeedsParser.inc
FeedsHTTPBatch::getRaw in plugins/FeedsHTTPFetcher.inc
Implements FeedsImportBatch::getRaw();
FeedsHTTPFetcher::clear in plugins/FeedsHTTPFetcher.inc
Clear caches.

... See full list

File

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

Code

function feeds_include_library($file, $library) {
  static $included = array();
  if (!isset($included[$file])) {

    // Try first whether libraries module is present and load the file from
    // there. If this fails, require the library from the local path.
    if (module_exists('libraries') && file_exists(libraries_get_path($library) . "/{$file}")) {
      require libraries_get_path($library) . "/{$file}";
    }
    else {
      require DRUPAL_ROOT . '/' . drupal_get_path('module', 'feeds') . "/libraries/{$file}";
    }
  }
  $included[$file] = TRUE;
}