You are here

function _patterns_io_is_patterns_dir_ready in Patterns 7.2

Same name and namespace in other branches
  1. 7 includes/io/io.inc \_patterns_io_is_patterns_dir_ready()

Checks if the patterns directory exists and is writable.

3 calls to _patterns_io_is_patterns_dir_ready()
patterns_requirements in ./patterns.install
Implements hook_requirements().
_patterns_import_check_dirs in includes/forms/import.inc
Helper function to be called in one of the import validation handlers.
_patterns_io_import_check_dirs in includes/io/import.inc
Helper function to be called in one of the import validation handlers.

File

includes/io/io.inc, line 358
Functions related to input/output operations.

Code

function _patterns_io_is_patterns_dir_ready($patterns_files_dir = NULL, $flag = FILE_MODIFY_PERMISSIONS) {

  // TODO: keep pattern_files_dir in a separate location. Warning: defining a constant creates an error.
  if (empty($patterns_files_dir)) {
    $patterns_files_dir = patterns_path_get_files_dir();

    // TODO: move this out for performance
  }
  return file_prepare_directory($patterns_files_dir, $flag) ? TRUE : FALSE;
}