You are here

protected function D3LibraryInfoProcessor::processFile in d3.js 7

Load a file specified in an info file.

If the library info file specifies a file name, then the information for that library will reside in a file. Load that file and see if it has the proper function.

1 call to D3LibraryInfoProcessor::processFile()
D3LibraryInfoProcessor::processValues in includes/D3LibraryInfoProcessor.inc
Sub function to start a recursive process.

File

includes/D3LibraryInfoProcessor.inc, line 139
D3 .info file processor class.

Class

D3LibraryInfoProcessor
Parse additional information from library .info files.

Code

protected function processFile(&$value) {
  $key = $this
    ->getKey();
  $library = $this->library
    ->value();

  // If they passed a filename for the field definition.
  $path = !empty($library['library path']) ? $library['library path'] : '';

  // TODO: find out if it's definitely a file and see if we can return an error.
  if (file_exists(DRUPAL_ROOT . '/' . $path . '/' . $value)) {
    require_once DRUPAL_ROOT . '/' . $path . '/' . $value;
    $func = 'd3_library_' . str_replace('d3.', '', $library['machine name']) . '_' . $key;
    if (function_exists($func)) {
      $value = $func();
      $this
        ->processMeta($value);
    }
  }
}