You are here

protected function JmesRuntimeFactory::validateCompileDirectory in Feeds extensible parsers 8

Validates that a compile directory exists and is valid.

Parameters

string $directory: A directory path.

Return value

bool True if the directory exists and is writable, false if not.

1 call to JmesRuntimeFactory::validateCompileDirectory()
JmesRuntimeFactory::getCompileDirectory in src/JmesRuntimeFactory.php
Returns the compilation directory.

File

src/JmesRuntimeFactory.php, line 97

Class

JmesRuntimeFactory
Defines a factory for generating JMESPath runtime objects.

Namespace

Drupal\feeds_ex

Code

protected function validateCompileDirectory($directory) {
  if (!$directory) {
    return FALSE;
  }
  return \Drupal::service('file_system')
    ->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS);
}