You are here

protected static function FeedsExJsonUtility::loadJsonPathUsingPath in Feeds extensible parsers 7

Tries to load the jsonpath library by looking for a path.

Return value

bool True if loading succeed. False otherwise.

1 call to FeedsExJsonUtility::loadJsonPathUsingPath()
FeedsExJsonUtility::jsonPathParserInstalled in src/Json/Utility.php
Determines if a JSONPath parser is installed.

File

src/Json/Utility.php, line 201
Contains FeedsExJsonUtility.

Class

FeedsExJsonUtility
Various helpers for handling JSON.

Code

protected static function loadJsonPathUsingPath() {

  // Try loading the library by looking for it manually.
  $path = static::jsonPathLibraryPath();
  if (!$path) {
    return FALSE;
  }
  if (is_array($path)) {
    foreach ($path as $subpath) {
      require_once DRUPAL_ROOT . '/' . $subpath;
    }
  }
  else {
    require_once DRUPAL_ROOT . '/' . $path;
  }
  if (!class_exists('\\Flow\\JSONPath\\JSONPath', TRUE)) {
    return FALSE;
  }
  return TRUE;
}