You are here

protected function FeedsExJmesPath::getCompileDirectory in Feeds extensible parsers 7

Returns the compilation directory.

Return value

string The directory JmesPath uses to store generated code.

1 call to FeedsExJmesPath::getCompileDirectory()
FeedsExJmesPath::search in src/FeedsExJmesPath.inc
Returns data from the input array that matches a JMESPath expression.

File

src/FeedsExJmesPath.inc, line 42
Contains FeedsExJmesPath.

Class

FeedsExJmesPath
Parses JSON documents with JMESPath.

Code

protected function getCompileDirectory() {

  // Look for a previous directory.
  $directory = variable_get('feeds_ex_jmespath_compile_dir');

  // The temp directory doesn't exist, or has moved.
  if (!$this
    ->validateCompileDirectory($directory)) {
    $directory = $this
      ->generateCompileDirectory();
    variable_set('feeds_ex_jmespath_compile_dir', $directory);

    // Creates the directory with the correct perms. We don't check the
    // return value since if it didn't work, there's nothing we can do. We
    // just fallback to the AstRuntime anyway.
    $this
      ->validateCompileDirectory($directory);
  }
  return $directory;
}