You are here

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

Tries to load the jsonpath library using the libraries module.

Return value

bool True if loading succeed. False otherwise.

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

File

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

Class

FeedsExJsonUtility
Various helpers for handling JSON.

Code

protected static function loadJsonPathUsingLibraries() {

  // If not, then we should have libraries installed.
  if (!module_exists('libraries')) {
    return FALSE;
  }
  $library = libraries_load('jsonpath');
  if ($library['loaded'] === FALSE) {
    return FALSE;
  }
  if (!class_exists('\\Flow\\JSONPath\\JSONPath', TRUE)) {
    return FALSE;
  }
  return TRUE;
}