You are here

function feeds_include_library in Feeds 6

Same name and namespace in other branches
  1. 8.2 feeds.module \feeds_include_library()
  2. 7.2 feeds.module \feeds_include_library()
  3. 7 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
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
FeedsCSVParser::parse in plugins/FeedsCSVParser.inc
Implementation of FeedsParser::parse().
FeedsEnclosure::getContent in plugins/FeedsParser.inc
FeedsHTTPBatch::getRaw in plugins/FeedsHTTPFetcher.inc
Implementation of FeedsImportBatch::getRaw();
FeedsHTTPFetcher::clear in plugins/FeedsHTTPFetcher.inc
Clear caches.

... See full list

File

./feeds.module, line 912
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_get_path('module', 'feeds') . "/libraries/{$file}";
    }
  }
  $included[$file] = TRUE;
}